mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
fix delete chat message
This commit is contained in:
@@ -173,8 +173,10 @@ api.deleteChatMessage = function(req, res, next){
|
||||
|
||||
if(message === undefined) return res.json(500, {err: "Message not found!"});
|
||||
|
||||
if(user.id !== message.uuid || (user.backer && !user.backer.admin)){
|
||||
return res.json(500, {err: "Not authorized to delete this message!"});
|
||||
if(user.id !== message.uuid){
|
||||
if(!user.backer || (user.backer && !user.backer.admin)){
|
||||
return res.json(500, {err: "Not authorized to delete this message!"})
|
||||
}
|
||||
}
|
||||
|
||||
group.chat = _.without(group.chat, message);
|
||||
|
||||
Reference in New Issue
Block a user