diff --git a/src/api/endpoints/posts/timeline.ts b/src/api/endpoints/posts/timeline.ts index 91cba0a04741bc5c1ef3b865f14c1fb34c07017b..6cc7825e64d9bc05c6c3f09366950baf96319cea 100644 --- a/src/api/endpoints/posts/timeline.ts +++ b/src/api/endpoints/posts/timeline.ts @@ -77,7 +77,17 @@ module.exports = async (params, user, app) => { channel_id: { $in: watchingChannelIds } - }] + }], + // mute + user_id: { + $nin: mutes + }, + '_reply.user_id': { + $nin: mutes + }, + '_repost.user_id': { + $nin: mutes + }, } as any; if (sinceId) { diff --git a/src/api/models/mute.ts b/src/api/models/mute.ts new file mode 100644 index 0000000000000000000000000000000000000000..16018b82f7897d852ee3d9a5045e79cf5d0789be --- /dev/null +++ b/src/api/models/mute.ts @@ -0,0 +1,3 @@ +import db from '../../db/mongodb'; + +export default db.get('mute') as any; // fuck type definition