diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-21 11:08:27 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-21 11:08:27 +0900 |
| commit | ffd13accca426f84f227b896b00b5b30b1121148 (patch) | |
| tree | d4b829dbc23bfd6fb898cd6c9085846d9bad11eb /src | |
| parent | :100: (diff) | |
| download | sharkey-ffd13accca426f84f227b896b00b5b30b1121148.tar.gz sharkey-ffd13accca426f84f227b896b00b5b30b1121148.tar.bz2 sharkey-ffd13accca426f84f227b896b00b5b30b1121148.zip | |
Refactor
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/note/create.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 03ca908297..7bc2dddc4f 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -25,17 +25,14 @@ import isQuote from '../../misc/is-quote'; import { TextElementMention } from '../../mfm/parse/elements/mention'; import { TextElementHashtag } from '../../mfm/parse/elements/hashtag'; -type Type = 'reply' | 'renote' | 'quote' | 'mention'; +type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; -/** - * 通知を担当 - */ class NotificationManager { private notifier: IUser; private note: INote; private queue: Array<{ target: ILocalUser['_id']; - reason: Type; + reason: NotificationType; }>; constructor(notifier: IUser, note: INote) { @@ -44,7 +41,7 @@ class NotificationManager { this.queue = []; } - public push(notifiee: ILocalUser['_id'], reason: Type) { + public push(notifiee: ILocalUser['_id'], reason: NotificationType) { // 自分自身へは通知しない if (this.notifier._id.equals(notifiee)) return; @@ -361,7 +358,7 @@ function index(note: INote) { }); } -async function notifyToWatchersOfRenotee(renote: INote, user: IUser, nm: NotificationManager, type: Type) { +async function notifyToWatchersOfRenotee(renote: INote, user: IUser, nm: NotificationManager, type: NotificationType) { const watchers = await NoteWatching.find({ noteId: renote._id, userId: { $ne: user._id } |