1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +01:00

Update ChannelService.ts

This commit is contained in:
Flam3rboy 2021-09-17 10:57:24 +02:00 committed by GitHub
parent 4f87fd742f
commit f4db45ad9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ export class ChannelService {
recipients = recipients.unique().filter((x) => x !== creator_user_id);
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) });
// TODO: check config for max number of recipients
if (otherRecipientsUsers.length !== recipients.length) {
throw new HTTPError("Recipient/s not found");
}
@ -85,4 +86,4 @@ export class ChannelService {
}, channel_id: channel.id
} as ChannelRecipientRemoveEvent);
}
}
}