Resolve conflicts

This commit is contained in:
syuilo
2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View File

@@ -19,25 +19,25 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
if (limitErr) return rej('invalid limit param');
const mute = await Mute.find({
muter_id: user._id,
deleted_at: { $exists: false }
muterId: user._id,
deletedAt: { $exists: false }
});
// Get history
const history = await History
.find({
user_id: user._id,
partner: {
$nin: mute.map(m => m.mutee_id)
userId: user._id,
partnerId: {
$nin: mute.map(m => m.muteeId)
}
}, {
limit: limit,
sort: {
updated_at: -1
updatedAt: -1
}
});
// Serialize
res(await Promise.all(history.map(async h =>
await pack(h.message, user))));
await pack(h.messageId, user))));
});