Post --> Note

Closes #1411
This commit is contained in:
syuilo 2018-04-08 02:30:37 +09:00
parent c7106d250c
commit a1b490afa7
167 changed files with 4440 additions and 1762 deletions

View file

@ -2,7 +2,7 @@ import * as mongo from 'mongodb';
import deepcopy = require('deepcopy');
import db from '../db/mongodb';
import { IUser, pack as packUser } from './user';
import { pack as packPost } from './post';
import { pack as packNote } from './note';
const Notification = db.get<INotification>('notifications');
export default Notification;
@ -36,12 +36,12 @@ export interface INotification {
* follow -
* mention - 稿
* reply - (Watchしている)稿
* repost - (Watchしている)稿Repostされた
* quote - (Watchしている)稿Repostされた
* renote - (Watchしている)稿Renoteされた
* quote - (Watchしている)稿Renoteされた
* reaction - (Watchしている)稿
* poll_vote - (Watchしている)稿
*/
type: 'follow' | 'mention' | 'reply' | 'repost' | 'quote' | 'reaction' | 'poll_vote';
type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'poll_vote';
/**
*
@ -91,12 +91,12 @@ export const pack = (notification: any) => new Promise<any>(async (resolve, reje
break;
case 'mention':
case 'reply':
case 'repost':
case 'renote':
case 'quote':
case 'reaction':
case 'poll_vote':
// Populate post
_notification.post = await packPost(_notification.postId, me);
// Populate note
_notification.note = await packNote(_notification.noteId, me);
break;
default:
console.error(`Unknown type: ${_notification.type}`);