mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: backend logic fixes for #12853
This commit is contained in:
@@ -344,14 +344,14 @@ define('forum/chats/messages', [
|
||||
return;
|
||||
}
|
||||
|
||||
api.del(`/chats/${roomId}/messages/${messageId}`, {}).then(() => {
|
||||
api.del(`/chats/${roomId}/messages/${encodeURIComponent(messageId)}`, {}).then(() => {
|
||||
components.get('chat/message', messageId).toggleClass('deleted', true);
|
||||
}).catch(alerts.error);
|
||||
});
|
||||
};
|
||||
|
||||
messages.restore = function (messageId, roomId) {
|
||||
api.post(`/chats/${roomId}/messages/${messageId}`, {}).then(() => {
|
||||
api.post(`/chats/${roomId}/messages/${encodeURIComponent(messageId)}`, {}).then(() => {
|
||||
components.get('chat/message', messageId).toggleClass('deleted', false);
|
||||
}).catch(alerts.error);
|
||||
};
|
||||
|
||||
@@ -152,7 +152,6 @@ Assert.message = helpers.try(async (req, res, next) => {
|
||||
}
|
||||
|
||||
if (
|
||||
!isFinite(req.params.mid) ||
|
||||
!(await messaging.messageExists(req.params.mid)) ||
|
||||
!(await messaging.canViewMessage(req.params.mid, roomId || req.params.roomId, req.uid))
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user