Fix quote notification filtering and add settings (#35690)
This commit is contained in:
@@ -161,7 +161,9 @@ export const processNewNotificationForGroups = createAppAsyncThunk(
|
|||||||
if (!showInColumn) return;
|
if (!showInColumn) return;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(notification.type === 'mention' || notification.type === 'update') &&
|
(notification.type === 'mention' ||
|
||||||
|
notification.type === 'update' ||
|
||||||
|
notification.type === 'quote') &&
|
||||||
notification.status?.filtered
|
notification.status?.filtered
|
||||||
) {
|
) {
|
||||||
const filters = notification.status.filtered.filter((result) =>
|
const filters = notification.status.filtered.filter((result) =>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
|
|||||||
|
|
||||||
let filtered = false;
|
let filtered = false;
|
||||||
|
|
||||||
if (['mention', 'status'].includes(notification.type) && notification.status.filtered) {
|
if (['mention', 'status', 'quote'].includes(notification.type) && notification.status.filtered) {
|
||||||
const filters = notification.status.filtered.filter(result => result.filter.context.includes('notifications'));
|
const filters = notification.status.filtered.filter(result => result.filter.context.includes('notifications'));
|
||||||
|
|
||||||
if (filters.some(result => result.filter.filter_action === 'hide')) {
|
if (filters.some(result => result.filter.filter_action === 'hide')) {
|
||||||
|
|||||||
@@ -143,6 +143,17 @@ class ColumnSettings extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section role='group' aria-labelledby='notifications-quote'>
|
||||||
|
<h3 id='notifications-quote'><FormattedMessage id='notifications.column_settings.quote' defaultMessage='Quotes:' /></h3>
|
||||||
|
|
||||||
|
<div className='column-settings__row'>
|
||||||
|
<SettingToggle disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'quote']} onChange={onChange} label={alertStr} />
|
||||||
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'quote']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'quote']} onChange={onChange} label={showStr} />
|
||||||
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'quote']} onChange={onChange} label={soundStr} />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section role='group' aria-labelledby='notifications-poll'>
|
<section role='group' aria-labelledby='notifications-poll'>
|
||||||
<h3 id='notifications-poll'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></h3>
|
<h3 id='notifications-poll'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></h3>
|
||||||
|
|
||||||
|
|||||||
@@ -658,6 +658,7 @@
|
|||||||
"notifications.column_settings.mention": "Mentions:",
|
"notifications.column_settings.mention": "Mentions:",
|
||||||
"notifications.column_settings.poll": "Poll results:",
|
"notifications.column_settings.poll": "Poll results:",
|
||||||
"notifications.column_settings.push": "Push notifications",
|
"notifications.column_settings.push": "Push notifications",
|
||||||
|
"notifications.column_settings.quote": "Quotes:",
|
||||||
"notifications.column_settings.reblog": "Boosts:",
|
"notifications.column_settings.reblog": "Boosts:",
|
||||||
"notifications.column_settings.show": "Show in column",
|
"notifications.column_settings.show": "Show in column",
|
||||||
"notifications.column_settings.sound": "Play sound",
|
"notifications.column_settings.sound": "Play sound",
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const initialState = ImmutableMap({
|
|||||||
follow_request: false,
|
follow_request: false,
|
||||||
favourite: false,
|
favourite: false,
|
||||||
reblog: false,
|
reblog: false,
|
||||||
|
quote: false,
|
||||||
mention: false,
|
mention: false,
|
||||||
poll: false,
|
poll: false,
|
||||||
status: false,
|
status: false,
|
||||||
@@ -59,6 +60,7 @@ const initialState = ImmutableMap({
|
|||||||
follow_request: false,
|
follow_request: false,
|
||||||
favourite: true,
|
favourite: true,
|
||||||
reblog: true,
|
reblog: true,
|
||||||
|
quote: true,
|
||||||
mention: true,
|
mention: true,
|
||||||
poll: true,
|
poll: true,
|
||||||
status: true,
|
status: true,
|
||||||
@@ -72,6 +74,7 @@ const initialState = ImmutableMap({
|
|||||||
follow_request: false,
|
follow_request: false,
|
||||||
favourite: true,
|
favourite: true,
|
||||||
reblog: true,
|
reblog: true,
|
||||||
|
quote: true,
|
||||||
mention: true,
|
mention: true,
|
||||||
poll: true,
|
poll: true,
|
||||||
status: true,
|
status: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user