add bite notification support (direct & notes)
This commit is contained in:
parent
fe1a32554c
commit
d1a3f670a6
6 changed files with 62 additions and 5 deletions
|
@ -102,6 +102,22 @@
|
|||
{{ ' ' }}
|
||||
<small>{{ $t('notifications.follow_request') }}</small>
|
||||
</span>
|
||||
<span v-if="notification.type === 'bite'">
|
||||
<FAIcon
|
||||
class="type-icon"
|
||||
icon="tooth"
|
||||
/>
|
||||
{{ ' ' }}
|
||||
<small>{{ $t('notifications.bit') }}</small>
|
||||
</span>
|
||||
<span v-if="notification.type === 'bite_note'">
|
||||
<FAIcon
|
||||
class="type-icon"
|
||||
icon="tooth"
|
||||
/>
|
||||
{{ ' ' }}
|
||||
<small>{{ $t('notifications.bit_note') }}</small>
|
||||
</span>
|
||||
<span v-if="notification.type === 'move'">
|
||||
<FAIcon
|
||||
class="type-icon"
|
||||
|
@ -222,6 +238,12 @@
|
|||
@{{ notification.target.screen_name_ui }}
|
||||
</router-link>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="notification.type === 'bite'"
|
||||
|
||||
class="move-text"
|
||||
>
|
||||
</div>
|
||||
<template v-else>
|
||||
<StatusContent
|
||||
class="faint"
|
||||
|
|
|
@ -70,6 +70,15 @@
|
|||
:class="{ 'menu-checkbox-checked': filters.polls }"
|
||||
/>{{ $t('settings.notification_visibility_polls') }}
|
||||
</button>
|
||||
<button
|
||||
class="button-default dropdown-item"
|
||||
@click="toggleNotificationFilter('bites')"
|
||||
>
|
||||
<span
|
||||
class="menu-checkbox"
|
||||
:class="{ 'menu-checkbox-checked': filters.bites }"
|
||||
/>{{ $t('settings.notification_visibility_bites') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<template #trigger>
|
||||
|
|
|
@ -46,6 +46,11 @@
|
|||
{{ $t('settings.notification_visibility_polls') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting path="notificationVisibility.bites">
|
||||
{{ $t('settings.notification_visibility_bites') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -326,6 +326,8 @@
|
|||
"who_to_follow": "Who to follow"
|
||||
},
|
||||
"notifications": {
|
||||
"bit": "bit you!",
|
||||
"bit_note": "bit your note!",
|
||||
"broken_favorite": "Unknown post, searching for it…",
|
||||
"error": "Error fetching notifications: {0}",
|
||||
"favorited_you": "favorited your post",
|
||||
|
@ -668,6 +670,7 @@
|
|||
"notification_setting_hide_notification_contents": "Hide the sender and contents of push notifications",
|
||||
"notification_setting_privacy": "Privacy",
|
||||
"notification_visibility": "Types of notifications to show",
|
||||
"notification_visibility_bites": "Bites",
|
||||
"notification_visibility_emoji_reactions": "Reactions",
|
||||
"notification_visibility_follows": "Follows",
|
||||
"notification_visibility_likes": "Favorites",
|
||||
|
|
|
@ -418,9 +418,19 @@ export const parseNotification = (data) => {
|
|||
output.status = isStatusNotification(output.type) ? parseStatus(data.status) : null
|
||||
output.action = output.status // TODO: Refactor, this is unneeded
|
||||
}
|
||||
output.target = output.type !== 'move'
|
||||
? null
|
||||
: parseUser(data.target)
|
||||
output.target = null;
|
||||
if (output.type === 'move') {
|
||||
output.target = parseUser(data.target)
|
||||
}
|
||||
if (output.type === 'bite') {
|
||||
output.target = parseUser(data.account)
|
||||
|
||||
if (data.status) {
|
||||
output.type = "bite_note"
|
||||
output.status = parseStatus(data.status)
|
||||
output.action = output.status // TODO: Refactor, this is unneeded
|
||||
}
|
||||
}
|
||||
output.from_profile = parseUser(data.account)
|
||||
output.emoji = data.emoji
|
||||
output.emoji_url = data.emoji_url
|
||||
|
|
|
@ -15,11 +15,13 @@ export const visibleTypes = store => {
|
|||
rootState.config.notificationVisibility.followRequest && 'follow_request',
|
||||
rootState.config.notificationVisibility.moves && 'move',
|
||||
rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction',
|
||||
rootState.config.notificationVisibility.polls && 'poll'
|
||||
rootState.config.notificationVisibility.polls && 'poll',
|
||||
rootState.config.notificationVisibility.bites && 'bite',
|
||||
rootState.config.notificationVisibility.bites && 'bite_note'
|
||||
].filter(_ => _))
|
||||
}
|
||||
|
||||
const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reaction', 'poll']
|
||||
const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reaction', 'poll', 'bite_note']
|
||||
|
||||
export const isStatusNotification = (type) => includes(statusNotifications, type)
|
||||
|
||||
|
@ -102,6 +104,12 @@ export const prepareNotificationObject = (notification, i18n, store) => {
|
|||
case 'poll':
|
||||
i18nString = 'poll_ended'
|
||||
break
|
||||
case 'bite':
|
||||
i18nString = 'bit'
|
||||
break
|
||||
case 'bite_note':
|
||||
i18nString = 'bit_note'
|
||||
break
|
||||
}
|
||||
|
||||
if (notification.type === 'pleroma:emoji_reaction') {
|
||||
|
|
Loading…
Add table
Reference in a new issue