This commit is contained in:
syuilo
2018-07-04 13:21:30 +09:00
parent 4636768810
commit 67afe968b4
5 changed files with 85 additions and 19 deletions

View File

@ -18,6 +18,7 @@ import { IApp } from '../../models/app';
import UserList from '../../models/user-list';
import resolveUser from '../../remote/resolve-user';
import Meta from '../../models/meta';
import config from '../../config';
type Type = 'reply' | 'renote' | 'quote' | 'mention';
@ -366,7 +367,7 @@ export default async (user: IUser, data: {
watch(user._id, data.reply);
}
// (自分自身へのリプライでない限りは)通知を作成
// 通知
nm.push(data.reply.userId, 'reply');
}
@ -427,4 +428,18 @@ export default async (user: IUser, data: {
});
}
}
// Register to search database
if (note.text && config.elasticsearch) {
const es = require('../../../db/elasticsearch');
es.index({
index: 'misskey',
type: 'note',
id: note._id.toString(),
body: {
text: note.text
}
});
}
});