From df27953f964d4f41c36dd8f99da5d62244e6fdc1 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Wed, 29 Jun 2022 02:49:35 +0900 Subject: Support audio/vnd.wave (#18737) See: https://datatracker.ietf.org/doc/html/rfc2361 And Misskey uses this mime type for wav file. --- app/models/media_attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index e6a0548eb..a24fb857b 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -58,7 +58,7 @@ class MediaAttachment < ApplicationRecord IMAGE_MIME_TYPES = %w(image/jpeg image/png image/gif image/webp).freeze VIDEO_MIME_TYPES = %w(video/webm video/mp4 video/quicktime video/ogg).freeze VIDEO_CONVERTIBLE_MIME_TYPES = %w(video/webm video/quicktime).freeze - AUDIO_MIME_TYPES = %w(audio/wave audio/wav audio/x-wav audio/x-pn-wave audio/ogg audio/vorbis audio/mpeg audio/mp3 audio/webm audio/flac audio/aac audio/m4a audio/x-m4a audio/mp4 audio/3gpp video/x-ms-asf).freeze + AUDIO_MIME_TYPES = %w(audio/wave audio/wav audio/x-wav audio/x-pn-wave audio/vnd.wave audio/ogg audio/vorbis audio/mpeg audio/mp3 audio/webm audio/flac audio/aac audio/m4a audio/x-m4a audio/mp4 audio/3gpp video/x-ms-asf).freeze BLURHASH_OPTIONS = { x_comp: 4, -- cgit From 3c24f19afedc2169a7a343c5af4a8f892d863f0b Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 30 Jun 2022 09:51:55 +0200 Subject: Fix reblogged statuses being erroneously shown as filtered (#18744) --- app/javascript/mastodon/components/status.js | 2 +- app/javascript/mastodon/selectors/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 4ca392824..238a0d734 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -338,7 +338,7 @@ class Status extends ImmutablePureComponent { ); } - const matchedFilters = status.get('filtered') || status.getIn(['reblog', 'filtered']); + const matchedFilters = status.get('matched_filters'); if (this.state.forceFilter === undefined ? matchedFilters : this.state.forceFilter) { const minHandlers = this.props.muted ? {} : { moveUp: this.handleHotkeyMoveUp, diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js index 6aeb8b7bd..bf1db4bb4 100644 --- a/app/javascript/mastodon/selectors/index.js +++ b/app/javascript/mastodon/selectors/index.js @@ -106,7 +106,7 @@ export const makeGetStatus = () => { return statusBase.withMutations(map => { map.set('reblog', statusReblog); map.set('account', accountBase); - map.set('filtered', filtered); + map.set('matched_filters', filtered); }); }, ); -- cgit From a233a9bfb5f384e89bdaef6e519fa20db2a99ae5 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 30 Jun 2022 10:39:29 +0200 Subject: Remove dead code in WebUI filtering code (#18745) --- app/javascript/mastodon/selectors/index.js | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'app') diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js index bf1db4bb4..187e3306d 100644 --- a/app/javascript/mastodon/selectors/index.js +++ b/app/javascript/mastodon/selectors/index.js @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { List as ImmutableList, Map as ImmutableMap, is } from 'immutable'; +import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; import { me } from '../initial_state'; const getAccountBase = (state, id) => state.getIn(['accounts', id], null); @@ -37,31 +37,6 @@ const toServerSideType = columnType => { } }; -const escapeRegExp = string => - string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string - -const regexFromKeywords = keywords => { - if (keywords.size === 0) { - return null; - } - - return new RegExp(keywords.map(keyword_filter => { - let expr = escapeRegExp(keyword_filter.get('keyword')); - - if (keyword_filter.get('whole_word')) { - if (/^[\w]/.test(expr)) { - expr = `\\b${expr}`; - } - - if (/[\w]$/.test(expr)) { - expr = `${expr}\\b`; - } - } - - return expr; - }).join('|'), 'i'); -}; - const getFilters = (state, { contextType }) => { if (!contextType) return null; -- cgit