diff --git a/app/soapbox/actions/notifications.js b/app/soapbox/actions/notifications.js index 105d7b666..1c91e96c5 100644 --- a/app/soapbox/actions/notifications.js +++ b/app/soapbox/actions/notifications.js @@ -153,7 +153,7 @@ export function dequeueNotifications() { const excludeTypesFromSettings = getState => getSettings(getState()).getIn(['notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); const excludeTypesFromFilter = filter => { - const allTypes = ImmutableList(['follow', 'follow_request', 'favourite', 'reblog', 'mention', 'poll', 'pleroma:emoji_reaction']); + const allTypes = ImmutableList(['follow', 'follow_request', 'favourite', 'reblog', 'mention', 'poll', 'move', 'pleroma:emoji_reaction']); return allTypes.filterNot(item => item === filter).toJS(); }; diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index d857fd1e9..e0612f75a 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -60,6 +60,7 @@ export const defaultSettings = ImmutableMap({ reblog: true, mention: true, poll: true, + move: true, 'pleroma:emoji_reaction': true, }), @@ -76,6 +77,7 @@ export const defaultSettings = ImmutableMap({ reblog: true, mention: true, poll: true, + move: true, 'pleroma:emoji_reaction': true, }), @@ -86,6 +88,7 @@ export const defaultSettings = ImmutableMap({ reblog: false, mention: false, poll: false, + move: false, 'pleroma:emoji_reaction': false, }), }), diff --git a/app/soapbox/features/notifications/components/column_settings.js b/app/soapbox/features/notifications/components/column_settings.js index 58ab309df..38437cfef 100644 --- a/app/soapbox/features/notifications/components/column_settings.js +++ b/app/soapbox/features/notifications/components/column_settings.js @@ -20,7 +20,7 @@ export default class ColumnSettings extends React.PureComponent { } onAllSoundsChange = (path, checked) => { - const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll']]; + const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll'], ['sounds', 'move']]; for (var i = 0; i < soundSettings.length; i++) { this.props.onChange(soundSettings[i], checked); @@ -36,7 +36,7 @@ export default class ColumnSettings extends React.PureComponent { const allSoundsStr = ; const showStr = ; const soundStr = ; - const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll']]; + const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll'], ['sounds', 'move']]; const showPushSettings = pushSettings.get('browserSupport') && pushSettings.get('isSubscribed'); const pushStr = showPushSettings && ; @@ -139,6 +139,17 @@ export default class ColumnSettings extends React.PureComponent { + +
+ + +
+ + {showPushSettings && } + + +
+
); } diff --git a/app/soapbox/features/notifications/components/filter_bar.js b/app/soapbox/features/notifications/components/filter_bar.js index cd7f00eda..19fa74877 100644 --- a/app/soapbox/features/notifications/components/filter_bar.js +++ b/app/soapbox/features/notifications/components/filter_bar.js @@ -9,6 +9,7 @@ const tooltips = defineMessages({ boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Reposts' }, polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' }, follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' }, + moves: { id: 'notifications.filter.moves', defaultMessage: 'Moves' }, emoji_reacts: { id: 'notifications.filter.emoji_reacts', defaultMessage: 'Emoji reacts:' }, }); @@ -102,6 +103,13 @@ class FilterBar extends React.PureComponent { > + ); return renderedElement; diff --git a/app/soapbox/features/notifications/components/notification.js b/app/soapbox/features/notifications/components/notification.js index 83654f17c..82a912a26 100644 --- a/app/soapbox/features/notifications/components/notification.js +++ b/app/soapbox/features/notifications/components/notification.js @@ -321,9 +321,34 @@ class Notification extends ImmutablePureComponent { ); } + renderMove(notification, account, targetAccount, link) { + const { intl } = this.props; + + const targetLink = {targetAccount.get('acct')}; + + return ( + +
+
+
+ +
+ + + + +
+ +
+
+ ); + } + render() { const { notification } = this.props; const account = notification.get('account'); + const targetAccount = notification.get('target'); const displayNameHtml = { __html: account.get('display_name_html') }; const link = ; @@ -340,6 +365,8 @@ class Notification extends ImmutablePureComponent { return this.renderReblog(notification, link); case 'poll': return this.renderPoll(notification); + case 'move': + return this.renderMove(notification, account, targetAccount, link); case 'pleroma:emoji_reaction': return this.renderEmojiReact(notification, link); case 'pleroma:chat_mention': diff --git a/app/soapbox/features/notifications/containers/notification_container.js b/app/soapbox/features/notifications/containers/notification_container.js index 367631193..345d3ba13 100644 --- a/app/soapbox/features/notifications/containers/notification_container.js +++ b/app/soapbox/features/notifications/containers/notification_container.js @@ -20,7 +20,7 @@ const makeMapStateToProps = () => { const getStatus = makeGetStatus(); const mapStateToProps = (state, props) => { - const notification = getNotification(state, props.notification, props.accountId); + const notification = getNotification(state, props.notification, props.accountId, props.targetId); return { notification: notification, status: notification.get('status') ? getStatus(state, { id: notification.get('status') }) : null, diff --git a/app/soapbox/features/notifications/index.js b/app/soapbox/features/notifications/index.js index a62eea8b4..d4f06eeeb 100644 --- a/app/soapbox/features/notifications/index.js +++ b/app/soapbox/features/notifications/index.js @@ -152,6 +152,7 @@ class Notifications extends React.PureComponent { key={item.get('id')} notification={item} accountId={item.get('account')} + targetId={item.get('target')} onMoveUp={this.handleMoveUp} onMoveDown={this.handleMoveDown} /> diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json index 532770f18..30e3fbb37 100644 --- a/app/soapbox/locales/pl.json +++ b/app/soapbox/locales/pl.json @@ -450,6 +450,7 @@ "notification.follow": "{name} zaczął(-ęła) Cię śledzić", "notification.follow_request": "{name} poprosił(a) Cię o możliwość śledzenia", "notification.mention": "{name} wspomniał(a) o tobie", + "notification.move": "{name} przeniósł(-osła) się na {targetName}", "notification.pleroma:emoji_reaction": "{name} zareagował(a) na Twój wpis", "notification.poll": "Głosowanie w którym brałeś(-aś) udział zakończyła się", "notification.reblog": "{name} podbił(a) Twój wpis", @@ -464,6 +465,7 @@ "notifications.column_settings.follow": "Nowi śledzący:", "notifications.column_settings.follow_request": "Nowe prośby o możliwość śledzenia:", "notifications.column_settings.mention": "Wspomnienia:", + "notifications.column_settings.move": "Przenoszone konta:", "notifications.column_settings.poll": "Wyniki głosowania:", "notifications.column_settings.push": "Powiadomienia push", "notifications.column_settings.reblog": "Podbicia:", @@ -477,6 +479,7 @@ "notifications.filter.favourites": "Ulubione", "notifications.filter.follows": "Śledzenia", "notifications.filter.mentions": "Wspomienia", + "notifications.filter.moves": "Przenoszone konta", "notifications.filter.polls": "Wyniki głosowania", "notifications.group": "{count, number} {count, plural, one {powiadomienie} few {powiadomienia} many {powiadomień} more {powiadomień}}", "notifications.queue_label": "Naciśnij aby zobaczyć {count} {count, plural, one {nowe powiadomienie} few {nowe powiadomienia} many {nowych powiadomień} other {nowe powiadomienia}}", diff --git a/app/soapbox/reducers/notifications.js b/app/soapbox/reducers/notifications.js index e37b51151..c07507c58 100644 --- a/app/soapbox/reducers/notifications.js +++ b/app/soapbox/reducers/notifications.js @@ -44,6 +44,7 @@ const notificationToMap = notification => ImmutableMap({ id: notification.id, type: notification.type, account: notification.account.id, + target: notification.target ? notification.target.id : null, created_at: notification.created_at, status: notification.status ? notification.status.id : null, emoji: notification.emoji, diff --git a/app/soapbox/selectors/index.js b/app/soapbox/selectors/index.js index 949c7a63d..85006973a 100644 --- a/app/soapbox/selectors/index.js +++ b/app/soapbox/selectors/index.js @@ -137,8 +137,9 @@ export const makeGetNotification = () => { return createSelector([ (_, base) => base, (state, _, accountId) => state.getIn(['accounts', accountId]), - ], (base, account) => { - return base.set('account', account); + (state, _, __, targetId) => state.getIn(['accounts', targetId]), + ], (base, account, target) => { + return base.set('account', account).set('target', target); }); };