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

Fix #2738

parent faf29b76
No related branches found
No related tags found
No related merge requests found
import * as mongo from 'mongodb';
function toString(id: any) {
return mongo.ObjectID.prototype.isPrototypeOf(id) ? (id as mongo.ObjectID).toHexString() : id;
}
export default function(note: any, mutedUserIds: string[]): boolean {
if (mutedUserIds.indexOf(note.userId) != -1) {
if (mutedUserIds.includes(toString(note.userId))) {
return true;
}
if (note.reply != null && mutedUserIds.indexOf(note.reply.userId) != -1) {
if (note.reply != null && mutedUserIds.includes(toString(note.reply.userId))) {
return true;
}
if (note.renote != null && mutedUserIds.indexOf(note.renote.userId) != -1) {
if (note.renote != null && mutedUserIds.includes(toString(note.renote.userId))) {
return true;
}
......
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