Change move namespacing, fix some emoji reactions related problems not noticed before

This commit is contained in:
Shpuld Shpuldson 2020-02-20 15:57:29 +02:00
parent 0abc3f9b85
commit 668a84f327
8 changed files with 18 additions and 11 deletions

View file

@ -4,7 +4,8 @@ const tabModeDict = {
mentions: ['mention'],
'likes+repeats': ['repeat', 'like'],
follows: ['follow'],
moves: ['move']
moves: ['pleroma:move'],
emoji_reactions: ['pleroma:emoji_reaction']
}
const Interactions = {

View file

@ -26,6 +26,10 @@
key="moves"
:label="$t('interactions.moves')"
/>
<span
key="emoji_reactions"
:label="$t('interactions.emoji_reactions')"
/>
</tab-switcher>
<Notifications
ref="notifications"

View file

@ -74,7 +74,7 @@
<i class="fa icon-user-plus lit" />
<small>{{ $t('notifications.followed_you') }}</small>
</span>
<span v-if="notification.type === 'move'">
<span v-if="notification.type === 'pleroma:move'">
<i class="fa icon-arrow-curved lit" />
<small>{{ $t('notifications.migrated_to') }}</small>
</span>
@ -87,7 +87,7 @@
</span>
</div>
<div
v-if="notification.type === 'follow' || notification.type === 'move'"
v-if="notification.type === 'follow' || notification.type === 'pleroma:move'"
class="timeago"
>
<span class="faint">
@ -127,7 +127,7 @@
</router-link>
</div>
<div
v-else-if="notification.type === 'move'"
v-else-if="notification.type === 'pleroma:move'"
class="move-text"
>
<router-link :to="targetUserProfileLink">

View file

@ -161,6 +161,7 @@
"favs_repeats": "Repeats and Favorites",
"follows": "New follows",
"moves": "User migrates",
"emoji_reactions": "Reactions",
"load_older": "Load older interactions"
},
"post_status": {

View file

@ -81,8 +81,8 @@ const visibleNotificationTypes = (rootState) => {
rootState.config.notificationVisibility.mentions && 'mention',
rootState.config.notificationVisibility.repeats && 'repeat',
rootState.config.notificationVisibility.follows && 'follow',
rootState.config.notificationVisibility.moves && 'move',
rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reactions'
rootState.config.notificationVisibility.moves && 'pleroma:move',
rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction'
].filter(_ => _)
}
@ -358,7 +358,7 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
case 'follow':
i18nString = 'followed_you'
break
case 'move':
case 'pleroma:move':
i18nString = 'migrated_to'
break
}

View file

@ -346,11 +346,11 @@ 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.type === 'move'
output.status = output.type === 'follow' || output.type === 'pleroma:move'
? null
: parseStatus(data.status)
output.action = output.status // TODO: Refactor, this is unneeded
output.target = output.type !== 'move'
output.target = output.type !== 'pleroma:move'
? null
: parseUser(data.target)
output.from_profile = parseUser(data.account)

View file

@ -7,7 +7,7 @@ export const visibleTypes = store => ([
store.state.config.notificationVisibility.mentions && 'mention',
store.state.config.notificationVisibility.repeats && 'repeat',
store.state.config.notificationVisibility.follows && 'follow',
store.state.config.notificationVisibility.moves && 'move',
store.state.config.notificationVisibility.moves && 'pleroma:move',
store.state.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction'
].filter(_ => _))

View file

@ -66,7 +66,8 @@ function sendSubscriptionToBackEnd (subscription, token, notificationVisibility)
favourite: notificationVisibility.likes,
mention: notificationVisibility.mentions,
reblog: notificationVisibility.repeats,
move: notificationVisibility.moves
'pleroma:move': notificationVisibility.moves,
'pleroma:emoji_reaction': notificationVisibility.emoji_reactions
}
}
})