Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
47c45d48b1 | |||
cdd9585cb8 | |||
db60188847 |
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "4.12.0",
|
||||
"clientVersion": "1.0.6780",
|
||||
"version": "4.13.0",
|
||||
"clientVersion": "1.0.6783",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="adsvaidqfznoartcbplullnejvxjphcn">
|
||||
<p>%fa:B twitter%<a :href="`https://twitter.com/${user.twitter.screenName}`" target="_blank">@{{ user.twitter.screenName }}</a></p>
|
||||
<span>%fa:B twitter%<a :href="`https://twitter.com/${user.twitter.screenName}`" target="_blank">@{{ user.twitter.screenName }}</a></span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -16,6 +16,11 @@ export default Vue.extend({
|
||||
.adsvaidqfznoartcbplullnejvxjphcn
|
||||
padding 32px
|
||||
background #1a94f2
|
||||
border-radius 6px
|
||||
color #fff
|
||||
|
||||
a
|
||||
margin-left 8px
|
||||
color #fff
|
||||
|
||||
</style>
|
||||
|
@ -27,51 +27,30 @@ type Type = 'reply' | 'renote' | 'quote' | 'mention';
|
||||
class NotificationManager {
|
||||
private notifier: IUser;
|
||||
private note: any;
|
||||
private queue: Array<{
|
||||
notifiee: ILocalUser['_id'],
|
||||
type: Type;
|
||||
}> = [];
|
||||
|
||||
constructor(notifier: IUser, note: any) {
|
||||
this.notifier = notifier;
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public push(notifiee: ILocalUser['_id'], type: Type) {
|
||||
public async push(notifiee: ILocalUser['_id'], type: Type) {
|
||||
// 自分自身へは通知しない
|
||||
if (this.notifier._id.equals(notifiee)) return;
|
||||
|
||||
const exist = this.queue.find(x => x.notifiee.equals(notifiee));
|
||||
// ミュート情報を取得
|
||||
const mentioneeMutes = await Mute.find({
|
||||
muterId: notifiee
|
||||
});
|
||||
|
||||
if (exist) {
|
||||
// 「メンションされているかつ返信されている」場合は、メンションとしての通知ではなく返信としての通知にする
|
||||
if (type != 'mention') {
|
||||
exist.type = type;
|
||||
}
|
||||
} else {
|
||||
this.queue.push({
|
||||
notifiee, type
|
||||
const mentioneesMutedUserIds = mentioneeMutes.map(m => m.muteeId.toString());
|
||||
|
||||
// 通知される側のユーザーが通知する側のユーザーをミュートしていない限りは通知する
|
||||
if (!mentioneesMutedUserIds.includes(this.notifier._id.toString())) {
|
||||
notify(notifiee, this.notifier._id, type, {
|
||||
noteId: this.note._id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public deliver() {
|
||||
this.queue.forEach(async x => {
|
||||
// ミュート情報を取得
|
||||
const mentioneeMutes = await Mute.find({
|
||||
muterId: x.notifiee
|
||||
});
|
||||
|
||||
const mentioneesMutedUserIds = mentioneeMutes.map(m => m.muteeId.toString());
|
||||
|
||||
// 通知される側のユーザーが通知する側のユーザーをミュートしていない限りは通知する
|
||||
if (!mentioneesMutedUserIds.includes(this.notifier._id.toString())) {
|
||||
notify(x.notifiee, this.notifier._id, x.type, {
|
||||
noteId: this.note._id
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default async (user: IUser, data: {
|
||||
|
Reference in New Issue
Block a user