[Glitch] Add notifications when a reblogged status has been updated

Port front-end changes from 8ffc48ebfa to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko 2022-02-11 22:20:19 +01:00 committed by Claire
parent 7c32406859
commit e5e6857bd7
5 changed files with 58 additions and 2 deletions

View file

@ -47,7 +47,6 @@ export const NOTIFICATIONS_UNMOUNT = 'NOTIFICATIONS_UNMOUNT';
export const NOTIFICATIONS_SET_VISIBILITY = 'NOTIFICATIONS_SET_VISIBILITY'; export const NOTIFICATIONS_SET_VISIBILITY = 'NOTIFICATIONS_SET_VISIBILITY';
export const NOTIFICATIONS_MARK_AS_READ = 'NOTIFICATIONS_MARK_AS_READ'; export const NOTIFICATIONS_MARK_AS_READ = 'NOTIFICATIONS_MARK_AS_READ';
export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT'; export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT';
@ -136,7 +135,17 @@ const excludeTypesFromSettings = state => state.getIn(['settings', 'notification
const excludeTypesFromFilter = filter => { const excludeTypesFromFilter = filter => {
const allTypes = ImmutableList(['follow', 'follow_request', 'favourite', 'reblog', 'mention', 'poll']); const allTypes = ImmutableList([
'follow',
'follow_request',
'favourite',
'reblog',
'mention',
'poll',
'status',
'update',
]);
return allTypes.filterNot(item => item === filter).toJS(); return allTypes.filterNot(item => item === filter).toJS();
}; };

View file

@ -88,6 +88,14 @@ export default class StatusPrepend extends React.PureComponent {
/> />
); );
} }
case 'update':
return (
<FormattedMessage
id='notification.update'
defaultMessage='{name} edited a post'
values={{ name: link }}
/>
);
} }
return null; return null;
} }
@ -115,6 +123,9 @@ export default class StatusPrepend extends React.PureComponent {
case 'status': case 'status':
iconId = 'bell'; iconId = 'bell';
break; break;
case 'update':
iconId = 'pencil';
break;
}; };
return !type ? null : ( return !type ? null : (

View file

@ -154,6 +154,17 @@ export default class ColumnSettings extends React.PureComponent {
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'status']} onChange={onChange} label={soundStr} /> <PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'status']} onChange={onChange} label={soundStr} />
</div> </div>
</div> </div>
<div role='group' aria-labelledby='notifications-update'>
<span id='notifications-status' className='column-settings__section'><FormattedMessage id='notifications.column_settings.update' defaultMessage='Edits:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'update']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'update']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'update']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'update']} onChange={onChange} label={soundStr} />
</div>
</div>
</div> </div>
); );
} }

View file

@ -171,6 +171,28 @@ export default class Notification extends ImmutablePureComponent {
unread={this.props.unread} unread={this.props.unread}
/> />
); );
case 'update':
return (
<StatusContainer
containerId={notification.get('id')}
hidden={hidden}
id={notification.get('status')}
account={notification.get('account')}
prepend='update'
muted
notification={notification}
onMoveDown={onMoveDown}
onMoveUp={onMoveUp}
onMention={onMention}
getScrollPosition={getScrollPosition}
updateScrollBottom={updateScrollBottom}
cachedMediaWidth={this.props.cachedMediaWidth}
cacheMediaWidth={this.props.cacheMediaWidth}
onUnmount={this.props.onUnmount}
withDismiss
unread={this.props.unread}
/>
);
default: default:
return null; return null;
} }

View file

@ -40,6 +40,7 @@ const initialState = ImmutableMap({
mention: false, mention: false,
poll: false, poll: false,
status: false, status: false,
update: false,
}), }),
quickFilter: ImmutableMap({ quickFilter: ImmutableMap({
@ -59,6 +60,7 @@ const initialState = ImmutableMap({
mention: true, mention: true,
poll: true, poll: true,
status: true, status: true,
update: true,
}), }),
sounds: ImmutableMap({ sounds: ImmutableMap({
@ -69,6 +71,7 @@ const initialState = ImmutableMap({
mention: true, mention: true,
poll: true, poll: true,
status: true, status: true,
update: true,
}), }),
}), }),