summaryrefslogtreecommitdiff
path: root/src/api/endpoints/messaging/history.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-12-22 14:21:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-12-22 14:21:40 +0900
commite21ab77dd5fc007cc92fffd4362890fbde89db56 (patch)
treec15edc7a40f01db01fc61c72cd29f3726e2f9a26 /src/api/endpoints/messaging/history.ts
parentoops (diff)
downloadmisskey-e21ab77dd5fc007cc92fffd4362890fbde89db56.tar.gz
misskey-e21ab77dd5fc007cc92fffd4362890fbde89db56.tar.bz2
misskey-e21ab77dd5fc007cc92fffd4362890fbde89db56.zip
wip
Diffstat (limited to 'src/api/endpoints/messaging/history.ts')
-rw-r--r--src/api/endpoints/messaging/history.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/api/endpoints/messaging/history.ts b/src/api/endpoints/messaging/history.ts
index 5f7c9276dd..f14740dff5 100644
--- a/src/api/endpoints/messaging/history.ts
+++ b/src/api/endpoints/messaging/history.ts
@@ -3,6 +3,7 @@
*/
import $ from 'cafy';
import History from '../../models/messaging-history';
+import Mute from '../../models/mute';
import serialize from '../../serializers/messaging-message';
/**
@@ -17,10 +18,18 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
if (limitErr) return rej('invalid limit param');
+ const mute = await Mute.find({
+ muter_id: user._id,
+ deleted_at: { $exists: false }
+ });
+
// Get history
const history = await History
.find({
- user_id: user._id
+ user_id: user._id,
+ partner: {
+ $nin: mute.map(m => m.mutee_id)
+ }
}, {
limit: limit,
sort: {