[Glitch] Fix quote notification filtering and add settings

Port a4c05c694f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-08-05 18:15:16 +02:00
parent 235037a3b2
commit dbb2908eeb
4 changed files with 18 additions and 2 deletions

View File

@@ -161,7 +161,9 @@ export const processNewNotificationForGroups = createAppAsyncThunk(
if (!showInColumn) return;
if (
(notification.type === 'mention' || notification.type === 'update') &&
(notification.type === 'mention' ||
notification.type === 'update' ||
notification.type === 'quote') &&
notification.status?.filtered
) {
const filters = notification.status.filtered.filter((result) =>

View File

@@ -31,7 +31,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
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'));
if (filters.some(result => result.filter.filter_action === 'hide')) {

View File

@@ -147,6 +147,17 @@ class ColumnSettings extends PureComponent {
</div>
</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'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'quote']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'quote']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'quote']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'quote']} onChange={onChange} label={soundStr} />
</div>
</section>
<section role='group' aria-labelledby='notifications-poll'>
<h3 id='notifications-poll'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></h3>

View File

@@ -37,6 +37,7 @@ const initialState = ImmutableMap({
follow_request: false,
favourite: false,
reblog: false,
quote: false,
mention: false,
poll: false,
status: false,
@@ -60,6 +61,7 @@ const initialState = ImmutableMap({
follow_request: false,
favourite: true,
reblog: true,
quote: true,
mention: true,
poll: true,
status: true,
@@ -73,6 +75,7 @@ const initialState = ImmutableMap({
follow_request: false,
favourite: true,
reblog: true,
quote: true,
mention: true,
poll: true,
status: true,