delete pollVote notification

This commit is contained in:
syuilo 2023-01-08 10:54:45 +09:00
parent 49f3090edd
commit 2e2ed1385f
8 changed files with 37 additions and 72 deletions

View file

@ -30,6 +30,7 @@ You should also include the user name that made the change.
#### For users #### For users
- ノートのウォッチ機能が削除されました - ノートのウォッチ機能が削除されました
- アンケートに投票された際に通知が作成されなくなりました
- 新たに動的なPagesを作ることはできなくなりました - 新たに動的なPagesを作ることはできなくなりました
- 代わりにAiScriptを用いてより柔軟に動的なコンテンツを作成できるMisskey Play機能が実装されています。 - 代わりにAiScriptを用いてより柔軟に動的なコンテンツを作成できるMisskey Play機能が実装されています。
- AiScriptが0.12.2にアップデートされました - AiScriptが0.12.2にアップデートされました

View file

@ -1550,7 +1550,6 @@ _notification:
youGotReply: "{name}からのリプライ" youGotReply: "{name}からのリプライ"
youGotQuote: "{name}による引用" youGotQuote: "{name}による引用"
youRenoted: "{name}がRenoteしました" youRenoted: "{name}がRenoteしました"
youGotPoll: "{name}が投票しました"
youGotMessagingMessageFromUser: "{name}からのチャットがあります" youGotMessagingMessageFromUser: "{name}からのチャットがあります"
youGotMessagingMessageFromGroup: "{name}のチャットがあります" youGotMessagingMessageFromGroup: "{name}のチャットがあります"
youWereFollowed: "フォローされました" youWereFollowed: "フォローされました"
@ -1569,7 +1568,6 @@ _notification:
renote: "Renote" renote: "Renote"
quote: "引用" quote: "引用"
reaction: "リアクション" reaction: "リアクション"
pollVote: "アンケートに投票された"
pollEnded: "アンケートが終了" pollEnded: "アンケートが終了"
receiveFollowRequest: "フォロー申請を受け取った" receiveFollowRequest: "フォロー申請を受け取った"
followRequestAccepted: "フォローが受理された" followRequestAccepted: "フォローが受理された"

View file

@ -92,13 +92,6 @@ export class PollService {
choice: choice, choice: choice,
userId: user.id, userId: user.id,
}); });
// Notify
this.createNotificationService.createNotification(note.userId, 'pollVote', {
notifierId: user.id,
noteId: note.id,
choice: choice,
});
} }
@bindThis @bindThis

View file

@ -98,7 +98,7 @@ export class NotificationEntityService implements OnModuleInit {
}), }),
reaction: notification.reaction, reaction: notification.reaction,
} : {}), } : {}),
...(notification.type === 'pollVote' ? { ...(notification.type === 'pollVote' ? { // TODO: そのうち消す
note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, { note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, {
detail: true, detail: true,
_hint_: options._hintForEachNotes_, _hint_: options._hintForEachNotes_,

View file

@ -55,11 +55,11 @@ export class Notification {
* *
* follow - * follow -
* mention - 稿 * mention - 稿
* reply - (Watchしている)稿 * reply - 稿
* renote - (Watchしている)稿Renoteされた * renote - 稿Renoteされた
* quote - (Watchしている)稿Renoteされた * quote - 稿Renoteされた
* reaction - (Watchしている)稿 * reaction - 稿
* pollVote - (Watchしている)稿 * pollVote - 稿 ()
* pollEnded - * pollEnded -
* receiveFollowRequest - * receiveFollowRequest -
* followRequestAccepted - * followRequestAccepted -

View file

@ -162,13 +162,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
userId: me.id, userId: me.id,
}); });
// Notify
this.createNotificationService.createNotification(note.userId, 'pollVote', {
notifierId: me.id,
noteId: note.id,
choice: ps.choice,
});
// リモート投票の場合リプライ送信 // リモート投票の場合リプライ送信
if (note.userHost != null) { if (note.userHost != null) {
const pollOwner = await this.usersRepository.findOneByOrFail({ id: note.userId }) as IRemoteUser; const pollOwner = await this.usersRepository.findOneByOrFail({ id: note.userId }) as IRemoteUser;

View file

@ -13,7 +13,6 @@
<i v-else-if="notification.type === 'reply'" class="ti ti-arrow-back-up"></i> <i v-else-if="notification.type === 'reply'" class="ti ti-arrow-back-up"></i>
<i v-else-if="notification.type === 'mention'" class="ti ti-at"></i> <i v-else-if="notification.type === 'mention'" class="ti ti-at"></i>
<i v-else-if="notification.type === 'quote'" class="ti ti-quote"></i> <i v-else-if="notification.type === 'quote'" class="ti ti-quote"></i>
<i v-else-if="notification.type === 'pollVote'" class="ti ti-chart-arrows"></i>
<i v-else-if="notification.type === 'pollEnded'" class="ti ti-chart-arrows"></i> <i v-else-if="notification.type === 'pollEnded'" class="ti ti-chart-arrows"></i>
<!-- notification.reaction null になることはまずないがここでoptional chaining使うと一部ブラウザで刺さるので念の為 --> <!-- notification.reaction null になることはまずないがここでoptional chaining使うと一部ブラウザで刺さるので念の為 -->
<XReactionIcon <XReactionIcon
@ -51,11 +50,6 @@
<MkA v-if="notification.type === 'quote'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)"> <MkA v-if="notification.type === 'quote'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)">
<Mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="!full"/> <Mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="!full"/>
</MkA> </MkA>
<MkA v-if="notification.type === 'pollVote'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)">
<i class="ti ti-quote"></i>
<Mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="!full"/>
<i class="ti ti-quote"></i>
</MkA>
<MkA v-if="notification.type === 'pollEnded'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)"> <MkA v-if="notification.type === 'pollEnded'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)">
<i class="ti ti-quote"></i> <i class="ti ti-quote"></i>
<Mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="!full"/> <Mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="!full"/>
@ -239,12 +233,6 @@ useTooltip(reactionRef, (showing) => {
pointer-events: none; pointer-events: none;
} }
&.pollVote {
padding: 3px;
background: #88a6b7;
pointer-events: none;
}
&.pollEnded { &.pollEnded {
padding: 3px; padding: 3px;
background: #88a6b7; background: #88a6b7;

View file

@ -51,8 +51,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: userDetail.isFollowing ? [] : [ actions: userDetail.isFollowing ? [] : [
{ {
action: 'follow', action: 'follow',
title: t('_notification._actions.followBack') title: t('_notification._actions.followBack'),
} },
], ],
}]; }];
} }
@ -66,8 +66,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'reply', action: 'reply',
title: t('_notification._actions.reply') title: t('_notification._actions.reply'),
} },
], ],
}]; }];
@ -80,8 +80,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'reply', action: 'reply',
title: t('_notification._actions.reply') title: t('_notification._actions.reply'),
} },
], ],
}]; }];
@ -94,8 +94,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'showUser', action: 'showUser',
title: getUserName(data.body.user) title: getUserName(data.body.user),
} },
], ],
}]; }];
@ -108,14 +108,14 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'reply', action: 'reply',
title: t('_notification._actions.reply') title: t('_notification._actions.reply'),
}, },
...((data.body.note.visibility === 'public' || data.body.note.visibility === 'home') ? [ ...((data.body.note.visibility === 'public' || data.body.note.visibility === 'home') ? [
{ {
action: 'renote', action: 'renote',
title: t('_notification._actions.renote') title: t('_notification._actions.renote'),
} },
] : []) ] : []),
], ],
}]; }];
@ -141,7 +141,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
const dummy = `${encodeURIComponent(`${u.host}${u.pathname}`)}.png`; const dummy = `${encodeURIComponent(`${u.host}${u.pathname}`)}.png`;
badge = `${origin}/proxy/${dummy}?${url.query({ badge = `${origin}/proxy/${dummy}?${url.query({
url: u.href, url: u.href,
badge: '1' badge: '1',
})}`; })}`;
} }
} }
@ -162,20 +162,12 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'showUser', action: 'showUser',
title: getUserName(data.body.user) title: getUserName(data.body.user),
} },
], ],
}]; }];
} }
case 'pollVote':
return [t('_notification.youGotPoll', { name: getUserName(data.body.user) }), {
body: data.body.note.text || '',
icon: data.body.user.avatarUrl,
badge: iconUrl('poll-h'),
data,
}];
case 'pollEnded': case 'pollEnded':
return [t('_notification.pollEnded'), { return [t('_notification.pollEnded'), {
body: data.body.note.text || '', body: data.body.note.text || '',
@ -192,12 +184,12 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'accept', action: 'accept',
title: t('accept') title: t('accept'),
}, },
{ {
action: 'reject', action: 'reject',
title: t('reject') title: t('reject'),
} },
], ],
}]; }];
@ -217,12 +209,12 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
actions: [ actions: [
{ {
action: 'accept', action: 'accept',
title: t('accept') title: t('accept'),
}, },
{ {
action: 'reject', action: 'reject',
title: t('reject') title: t('reject'),
} },
], ],
}]; }];
@ -230,7 +222,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
return [data.body.header || data.body.body, { return [data.body.header || data.body.body, {
body: data.body.header && data.body.body, body: data.body.header && data.body.body,
icon: data.body.icon, icon: data.body.icon,
data data,
}]; }];
default: default:
@ -279,7 +271,7 @@ export async function createEmptyNotification() {
silent: true, silent: true,
badge: iconUrl('null'), badge: iconUrl('null'),
tag: 'read_notification', tag: 'read_notification',
} },
); );
res(); res();
@ -288,7 +280,7 @@ export async function createEmptyNotification() {
for (const n of for (const n of
[ [
...(await self.registration.getNotifications({ tag: 'user_visible_auto_notification' })), ...(await self.registration.getNotifications({ tag: 'user_visible_auto_notification' })),
...(await self.registration.getNotifications({ tag: 'read_notification' })) ...(await self.registration.getNotifications({ tag: 'read_notification' })),
] ]
) { ) {
n.close(); n.close();