mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix(chat): validate group membership, by @phillipthelen
This commit is contained in:
@@ -36,7 +36,7 @@ export default class GroupChatReporter extends ChatReporter {
|
||||
});
|
||||
if (!group) throw new NotFound(this.res.t('groupNotFound'));
|
||||
|
||||
const message = await Chat.findOne({ _id: this.req.params.chatId }).exec();
|
||||
const message = await Chat.findOne({ _id: this.req.params.chatId, groupId: group._id }).exec();
|
||||
if (!message) throw new NotFound(this.res.t('messageGroupChatNotFound'));
|
||||
if (message.uuid === 'system') throw new BadRequest(this.res.t('messageCannotFlagSystemMessages', { communityManagerEmail: COMMUNITY_MANAGER_EMAIL }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user