Skip to content
Snippets Groups Projects
Unverified Commit 00a3f8d3 authored by syuilo's avatar syuilo
Browse files

Fix #2741

parent a5f817d8
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,14 @@ import Mute from '../../models/mute';
import { publishUserStream } from '../../stream';
export default async function(user: IUser, note: INote, isSpecified = false) {
//#region ミュートしているなら無視
const mute = await Mute.find({
muterId: user._id
});
const mutedUserIds = mute.map(m => m.muteeId.toString());
if (mutedUserIds.includes(note.userId.toString())) return;
//#endregion
const unread = await NoteUnread.insert({
noteId: note._id,
userId: user._id,
......@@ -19,14 +27,6 @@ export default async function(user: IUser, note: INote, isSpecified = false) {
const exist = await NoteUnread.findOne({ _id: unread._id });
if (exist == null) return;
//#region ただしミュートされているなら発行しない
const mute = await Mute.find({
muterId: user._id
});
const mutedUserIds = mute.map(m => m.muteeId.toString());
if (mutedUserIds.includes(note.userId.toString())) return;
//#endregion
User.update({
_id: user._id
}, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment