From b8bd94ca8edb5a675ef70aac9c941ed340efc127 Mon Sep 17 00:00:00 2001 From: Mashiro Date: Wed, 6 Mar 2024 20:53:54 +0800 Subject: [PATCH 1/4] Fix unhandled nullable attachments limitation counter (#29183) --- .../containers/upload_button_container.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/features/compose/containers/upload_button_container.js b/app/javascript/mastodon/features/compose/containers/upload_button_container.js index 7c4757b6c3..066e185346 100644 --- a/app/javascript/mastodon/features/compose/containers/upload_button_container.js +++ b/app/javascript/mastodon/features/compose/containers/upload_button_container.js @@ -3,14 +3,24 @@ import { connect } from 'react-redux'; import { uploadCompose } from '../../../actions/compose'; import UploadButton from '../components/upload_button'; -const mapStateToProps = state => ({ - disabled: state.getIn(['compose', 'poll']) !== null || state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size + state.getIn(['compose', 'pending_media_attachments']) > 3 || state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')))), - resetFileKey: state.getIn(['compose', 'resetFileKey']), -}); +const mapStateToProps = state => { + const isPoll = state.getIn(['compose', 'poll']) !== null; + const isUploading = state.getIn(['compose', 'is_uploading']); + const readyAttachmentsSize = state.getIn(['compose', 'media_attachments']).size ?? 0; + const pendingAttachmentsSize = state.getIn(['compose', 'pending_media_attachments']).size ?? 0; + const attachmentsSize = readyAttachmentsSize + pendingAttachmentsSize; + const isOverLimit = attachmentsSize > 3; + const hasVideoOrAudio = state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type'))); + + return { + disabled: isPoll || isUploading || isOverLimit || hasVideoOrAudio, + resetFileKey: state.getIn(['compose', 'resetFileKey']), + }; +}; const mapDispatchToProps = dispatch => ({ - onSelectFile (files) { + onSelectFile(files) { dispatch(uploadCompose(files)); }, From 995e15c24ab24bf153463299ded92db89116fa13 Mon Sep 17 00:00:00 2001 From: gunchleoc Date: Thu, 7 Mar 2024 11:03:41 +0000 Subject: [PATCH 2/4] Add Jawi Malay to posting languages (#29098) --- app/helpers/languages_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb index 65ade9fd2a..539020ece9 100644 --- a/app/helpers/languages_helper.rb +++ b/app/helpers/languages_helper.rb @@ -109,6 +109,7 @@ module LanguagesHelper mn: ['Mongolian', 'Монгол хэл'].freeze, mr: ['Marathi', 'मराठी'].freeze, ms: ['Malay', 'Bahasa Melayu'].freeze, + 'ms-Arab': ['Jawi Malay', 'بهاس ملايو'].freeze, mt: ['Maltese', 'Malti'].freeze, my: ['Burmese', 'ဗမာစာ'].freeze, na: ['Nauru', 'Ekakairũ Naoero'].freeze, From c01f4cebed27a1c11085e8aebe7719b3cee7ae7f Mon Sep 17 00:00:00 2001 From: gunchleoc Date: Thu, 7 Mar 2024 11:04:31 +0000 Subject: [PATCH 3/4] Add Mohawk to posting languages (#27115) --- app/helpers/languages_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb index 539020ece9..79d8cf794c 100644 --- a/app/helpers/languages_helper.rb +++ b/app/helpers/languages_helper.rb @@ -197,6 +197,7 @@ module LanguagesHelper kab: ['Kabyle', 'Taqbaylit'].freeze, ldn: ['Láadan', 'Láadan'].freeze, lfn: ['Lingua Franca Nova', 'lingua franca nova'].freeze, + moh: ['Mohawk', 'Kanienʼkéha'].freeze, pdc: ['Pennsylvania Dutch', 'Pennsilfaani-Deitsch'].freeze, sco: ['Scots', 'Scots'].freeze, sma: ['Southern Sami', 'Åarjelsaemien Gïele'].freeze, From 653ce43abe0a928d944a15c433d2c8324f9b5e2a Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Thu, 7 Mar 2024 12:11:14 +0100 Subject: [PATCH 4/4] Update `json-jwt` gem to fix CVE-2023-51774 (#29520) --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6ee799eab2..59b24e1035 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -357,7 +357,7 @@ GEM jmespath (1.6.2) json (2.7.1) json-canonicalization (1.0.0) - json-jwt (1.15.3) + json-jwt (1.15.3.1) activesupport (>= 4.2) aes_key_wrap bindata