From 2bc63720a5f9da740fa8082d587b6cfdd0c652ee Mon Sep 17 00:00:00 2001 From: kPherox Date: Tue, 10 Dec 2019 23:54:28 +0900 Subject: [PATCH 1/6] fix parse for move type notifications --- src/i18n/en.json | 3 ++- src/modules/statuses.js | 5 ++++- src/services/entity_normalizer/entity_normalizer.service.js | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index 85146ef5..f46d5b3d 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -110,7 +110,8 @@ "notifications": "Notifications", "read": "Read!", "repeated_you": "repeated your status", - "no_more_notifications": "No more notifications" + "no_more_notifications": "No more notifications", + "moved_to": "moved to" }, "polls": { "add_poll": "Add Poll", diff --git a/src/modules/statuses.js b/src/modules/statuses.js index f11ffdcd..3cf74a43 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -305,7 +305,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us const addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes, rootGetters }) => { each(notifications, (notification) => { - if (notification.type !== 'follow') { + if (notification.type !== 'follow' && notification.type !== 'move') { notification.action = addStatusToGlobalStorage(state, notification.action).item notification.status = notification.status && addStatusToGlobalStorage(state, notification.status).item } @@ -338,6 +338,9 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot case 'follow': i18nString = 'followed_you' break + case 'move': + i18nString = 'moved_to' + break } if (i18nString) { diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index ca79df6f..ee007bee 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -341,10 +341,13 @@ export const parseNotification = (data) => { if (masto) { output.type = mastoDict[data.type] || data.type output.seen = data.pleroma.is_seen - output.status = output.type === 'follow' + output.status = output.type === 'follow' || output.type === 'move' ? null : parseStatus(data.status) output.action = output.status // TODO: Refactor, this is unneeded + output.target = output.type !== 'move' + ? null + : parseUser(data.target) output.from_profile = parseUser(data.account) } else { const parsedNotice = parseStatus(data.notice) From 6af870cd9069a8fc45b7684d264656dad0cf4a70 Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 11 Dec 2019 00:00:10 +0900 Subject: [PATCH 2/6] Add view for moves notifications --- src/components/notification/notification.vue | 14 +++++++++++++- src/components/notifications/notifications.scss | 7 ++++++- src/components/settings/settings.vue | 5 +++++ src/i18n/en.json | 1 + src/modules/config.js | 3 ++- src/modules/statuses.js | 3 ++- .../notification_utils/notification_utils.js | 3 ++- src/services/push/push.js | 3 ++- static/fontello.json | 6 ++++++ 9 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 1f192c77..cf4d8072 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -74,9 +74,13 @@ {{ $t('notifications.followed_you') }} + + + {{ $t('notifications.moved_to') }} +
@@ -115,6 +119,14 @@ @{{ notification.from_profile.screen_name }}
+
+ + @{{ notification.target.screen_name }} + +