Merge branch 'develop'

This commit is contained in:
syuilo
2019-05-20 00:12:42 +09:00
4 changed files with 11 additions and 3 deletions

View File

@ -114,7 +114,7 @@ export default define(meta, async (ps, user) => {
// Mark all as read
if (ps.markAsRead) {
readUserMessagingMessage(user.id, recipient.id, messages.map(x => x.id));
readUserMessagingMessage(user.id, recipient.id, messages.filter(m => m.recipientId === user.id).map(x => x.id));
}
return await Promise.all(messages.map(message => MessagingMessages.pack(message, user, {

View File

@ -32,7 +32,9 @@ export default define(meta, async (ps, me) => {
const joinings = await UserGroupJoinings.find({
userId: me.id,
userGroupId: Not(In(ownedGroups.map(x => x.id)))
...(ownedGroups.length > 0 ? {
userGroupId: Not(In(ownedGroups.map(x => x.id)))
} : {})
});
return await Promise.all(joinings.map(x => UserGroups.pack(x.userGroupId)));