Merge pull request #1394 from h3poteto/iss-1281
refs #1281 Handle emoji reactions in web socket
This commit is contained in:
commit
f97872db8b
@ -12,7 +12,8 @@ const state = (): NotificationState => {
|
||||
reply: true,
|
||||
reblog: true,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,7 +59,8 @@ describe('Preferences/Notification', () => {
|
||||
reply: false,
|
||||
reblog: false,
|
||||
favourite: false,
|
||||
follow: false
|
||||
follow: false,
|
||||
reaction: false
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -70,7 +72,8 @@ describe('Preferences/Notification', () => {
|
||||
reply: false,
|
||||
reblog: false,
|
||||
favourite: false,
|
||||
follow: false
|
||||
follow: false,
|
||||
reaction: false
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -93,7 +96,8 @@ describe('Preferences/Notification', () => {
|
||||
reply: false,
|
||||
reblog: false,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
}
|
||||
})
|
||||
expect(App.actions.loadPreferences).toBeCalled()
|
||||
|
@ -9,7 +9,8 @@ describe('Preferences/Notification', () => {
|
||||
reply: true,
|
||||
reblog: true,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,8 @@
|
||||
"reply": "Notify me when I receive a reply",
|
||||
"reblog": "Notify me when I receive a reblog",
|
||||
"favourite": "Notify me when I receive a favourite",
|
||||
"follow": "Notify me when I receive a follow"
|
||||
"follow": "Notify me when I receive a follow",
|
||||
"reaction": "Notify me when I receive a emoji reaction"
|
||||
}
|
||||
},
|
||||
"account": {
|
||||
@ -453,6 +454,10 @@
|
||||
"reblog": {
|
||||
"title": "Reblog",
|
||||
"body": "{{username}} boosted your status"
|
||||
},
|
||||
"reaction": {
|
||||
"title": "Reaction",
|
||||
"body": "{{username}} reacted your status"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1442,6 +1442,15 @@ const createNotification = (notification: Entity.Notification, notifyConfig: Not
|
||||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
case 'emoji_reaction':
|
||||
if (notifyConfig.reaction) {
|
||||
return {
|
||||
title: i18next.t('notification.reaction.title'),
|
||||
body: i18next.t('notification.reaction.body', { username: username(notification.account) }),
|
||||
silent: false
|
||||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
@ -45,7 +45,8 @@ const notify: Notify = {
|
||||
reply: true,
|
||||
reblog: true,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
}
|
||||
|
||||
const language: LanguageSet = {
|
||||
|
@ -1,34 +1,22 @@
|
||||
<template>
|
||||
<div id="notification">
|
||||
<h2>{{ $t('preferences.notification.title') }}</h2>
|
||||
<el-form class="section" label-position="right" label-width="250px" size="small">
|
||||
<el-form class="section" label-position="right" label-width="300px" size="small">
|
||||
<p class="description">{{ $t('preferences.notification.enable.description') }}</p>
|
||||
<el-form-item for="notifyReply" :label="$t('preferences.notification.enable.reply')">
|
||||
<el-switch
|
||||
id="notifyReply"
|
||||
v-model="notifyReply"
|
||||
active-color="#13ce66">
|
||||
</el-switch>
|
||||
<el-switch id="notifyReply" v-model="notifyReply" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item for="notifyReblog" :label="$t('preferences.notification.enable.reblog')">
|
||||
<el-switch
|
||||
id="notifyReblog"
|
||||
v-model="notifyReblog"
|
||||
active-color="#13ce66">
|
||||
</el-switch>
|
||||
<el-switch id="notifyReblog" v-model="notifyReblog" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item for="notifyReaction" :label="$t('preferences.notification.enable.reaction')">
|
||||
<el-switch id="notifyReaction" v-model="notifyReaction" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item for="notifyFavourite" :label="$t('preferences.notification.enable.favourite')">
|
||||
<el-switch
|
||||
id="notifyFavourite"
|
||||
v-model="notifyFavourite"
|
||||
active-color="#13ce66">
|
||||
</el-switch>
|
||||
<el-switch id="notifyFavourite" v-model="notifyFavourite" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item for="notifyFollow" :label="$t('preferences.notification.enable.follow')">
|
||||
<el-switch
|
||||
v-model="notifyFollow"
|
||||
active-color="#13ce66">
|
||||
</el-switch>
|
||||
<el-switch v-model="notifyFollow" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -77,11 +65,20 @@ export default {
|
||||
follow: value
|
||||
})
|
||||
}
|
||||
},
|
||||
notifyReaction: {
|
||||
get() {
|
||||
return this.$store.state.Preferences.Notification.notification.notify.reaction
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch('Preferences/Notification/updateNotify', {
|
||||
reaction: value
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('Preferences/Notification/loadNotification')
|
||||
.catch(() => {
|
||||
this.$store.dispatch('Preferences/Notification/loadNotification').catch(() => {
|
||||
this.$message({
|
||||
message: this.$t('message.preferences_load_error'),
|
||||
type: 'error'
|
||||
|
@ -18,7 +18,8 @@
|
||||
<icon name="star" scale="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span> favourited your status
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span
|
||||
>{{ $t('notification.favourite.body') }}
|
||||
</div>
|
||||
<div class="action-icon" role="presentation">
|
||||
<FailoverImg :src="message.account.avatar" :alt="`Avatar of ${message.account.username}`" />
|
||||
|
@ -14,7 +14,8 @@
|
||||
<icon name="user-plus" scale="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span> is now following you
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span
|
||||
>{{ $t('notification.follow.body') }}
|
||||
</div>
|
||||
<div class="action-icon" role="presentation">
|
||||
<FailoverImg :src="message.account.avatar" />
|
||||
|
@ -18,7 +18,8 @@
|
||||
{{ message.emoji }}
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span> reacted to your status
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span
|
||||
>{{ $t('notification.reaction.body') }}
|
||||
</div>
|
||||
<div class="action-icon" role="presentation">
|
||||
<FailoverImg :src="message.account.avatar" :alt="`Avatar of ${message.account.username}`" />
|
||||
|
@ -18,7 +18,8 @@
|
||||
<icon name="retweet" scala="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span> boosted your status
|
||||
<span class="bold" @click="openUser(message.account)"><bdi v-html="username(message.account)"></bdi></span
|
||||
>{{ $t('notification.reblog.body') }}
|
||||
</div>
|
||||
<div class="action-icon" role="presentation">
|
||||
<FailoverImg :src="message.account.avatar" :alt="`Avatar of ${message.account.username}`" />
|
||||
|
@ -39,7 +39,8 @@ const state = (): AppState => ({
|
||||
reply: true,
|
||||
reblog: true,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
},
|
||||
tootPadding: 8,
|
||||
timeFormat: TimeFormat.Absolute.value,
|
||||
|
@ -16,7 +16,8 @@ const state: NotificationState = {
|
||||
reply: true,
|
||||
reblog: true,
|
||||
favourite: true,
|
||||
follow: true
|
||||
follow: true,
|
||||
reaction: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
export type Notify = {
|
||||
reply: boolean,
|
||||
reblog: boolean,
|
||||
favourite: boolean,
|
||||
reply: boolean
|
||||
reblog: boolean
|
||||
favourite: boolean
|
||||
follow: boolean
|
||||
reaction: boolean
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user