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'], mentions: ['mention'],
'likes+repeats': ['repeat', 'like'], 'likes+repeats': ['repeat', 'like'],
follows: ['follow'], follows: ['follow'],
moves: ['move'] moves: ['pleroma:move'],
emoji_reactions: ['pleroma:emoji_reaction']
} }
const Interactions = { const Interactions = {

View File

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

View File

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

View File

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

View File

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

View File

@ -346,11 +346,11 @@ 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.type === 'move' output.status = output.type === 'follow' || output.type === 'pleroma: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' output.target = output.type !== 'pleroma:move'
? null ? null
: parseUser(data.target) : parseUser(data.target)
output.from_profile = parseUser(data.account) 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.mentions && 'mention',
store.state.config.notificationVisibility.repeats && 'repeat', store.state.config.notificationVisibility.repeats && 'repeat',
store.state.config.notificationVisibility.follows && 'follow', 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' store.state.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction'
].filter(_ => _)) ].filter(_ => _))

View File

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