summaryrefslogtreecommitdiff
path: root/src/api/models/notification.ts
diff options
context:
space:
mode:
authorha-dai <contact@haradai.net>2017-11-27 03:41:47 +0900
committerha-dai <contact@haradai.net>2017-11-27 03:41:47 +0900
commit6c75bc6d5188cbbf80fe1086fa0e8828f4edb873 (patch)
tree3ffedcc3a06e53269e92d2990cf0b3bb247ac04a /src/api/models/notification.ts
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
parentUpdate dependencies :rocket: (diff)
downloadmisskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.tar.gz
misskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.tar.bz2
misskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.zip
Merge branch 'master' of github.com:syuilo/misskey
Diffstat (limited to 'src/api/models/notification.ts')
-rw-r--r--src/api/models/notification.ts39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/api/models/notification.ts b/src/api/models/notification.ts
index 1065e8baaa..e3dc6c70a3 100644
--- a/src/api/models/notification.ts
+++ b/src/api/models/notification.ts
@@ -1,8 +1,47 @@
import * as mongo from 'mongodb';
import db from '../../db/mongodb';
+import { IUser } from './user';
export default db.get('notifications') as any; // fuck type definition
export interface INotification {
_id: mongo.ObjectID;
+ created_at: Date;
+
+ /**
+ * 通知の受信者
+ */
+ notifiee?: IUser;
+
+ /**
+ * 通知の受信者
+ */
+ notifiee_id: mongo.ObjectID;
+
+ /**
+ * イニシエータ(initiator)、Origin。通知を行う原因となったユーザー
+ */
+ notifier?: IUser;
+
+ /**
+ * イニシエータ(initiator)、Origin。通知を行う原因となったユーザー
+ */
+ notifier_id: mongo.ObjectID;
+
+ /**
+ * 通知の種類。
+ * follow - フォローされた
+ * mention - 投稿で自分が言及された
+ * reply - (自分または自分がWatchしている)投稿が返信された
+ * repost - (自分または自分がWatchしている)投稿がRepostされた
+ * quote - (自分または自分がWatchしている)投稿が引用Repostされた
+ * reaction - (自分または自分がWatchしている)投稿にリアクションされた
+ * poll_vote - (自分または自分がWatchしている)投稿の投票に投票された
+ */
+ type: 'follow' | 'mention' | 'reply' | 'repost' | 'quote' | 'reaction' | 'poll_vote';
+
+ /**
+ * 通知が読まれたかどうか
+ */
+ is_read: Boolean;
}