fix parse for move type notifications

This commit is contained in:
kPherox 2019-12-10 23:54:28 +09:00
parent e60d9f2d5a
commit 2bc63720a5
No known key found for this signature in database
GPG key ID: C04751C2BFA2F62D
3 changed files with 10 additions and 3 deletions

View file

@ -110,7 +110,8 @@
"notifications": "Notifications", "notifications": "Notifications",
"read": "Read!", "read": "Read!",
"repeated_you": "repeated your status", "repeated_you": "repeated your status",
"no_more_notifications": "No more notifications" "no_more_notifications": "No more notifications",
"moved_to": "moved to"
}, },
"polls": { "polls": {
"add_poll": "Add Poll", "add_poll": "Add Poll",

View file

@ -305,7 +305,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
const addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes, rootGetters }) => { const addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes, rootGetters }) => {
each(notifications, (notification) => { each(notifications, (notification) => {
if (notification.type !== 'follow') { if (notification.type !== 'follow' && notification.type !== 'move') {
notification.action = addStatusToGlobalStorage(state, notification.action).item notification.action = addStatusToGlobalStorage(state, notification.action).item
notification.status = notification.status && addStatusToGlobalStorage(state, notification.status).item notification.status = notification.status && addStatusToGlobalStorage(state, notification.status).item
} }
@ -338,6 +338,9 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
case 'follow': case 'follow':
i18nString = 'followed_you' i18nString = 'followed_you'
break break
case 'move':
i18nString = 'moved_to'
break
} }
if (i18nString) { if (i18nString) {

View file

@ -341,10 +341,13 @@ export const parseNotification = (data) => {
if (masto) { if (masto) {
output.type = mastoDict[data.type] || data.type output.type = mastoDict[data.type] || data.type
output.seen = data.pleroma.is_seen output.seen = data.pleroma.is_seen
output.status = output.type === 'follow' output.status = output.type === 'follow' || output.type === 'move'
? null ? null
: parseStatus(data.status) : parseStatus(data.status)
output.action = output.status // TODO: Refactor, this is unneeded output.action = output.status // TODO: Refactor, this is unneeded
output.target = output.type !== 'move'
? null
: parseUser(data.target)
output.from_profile = parseUser(data.account) output.from_profile = parseUser(data.account)
} else { } else {
const parsedNotice = parseStatus(data.notice) const parsedNotice = parseStatus(data.notice)