mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 09:36:16 +01:00
closes #6163
This commit is contained in:
@@ -246,10 +246,7 @@ SocketModules.chats.edit = function (socket, data, callback) {
|
||||
function (next) {
|
||||
Messaging.canEdit(data.mid, socket.uid, next);
|
||||
},
|
||||
function (allowed, next) {
|
||||
if (!allowed) {
|
||||
return next(new Error('[[error:cant-edit-chat-message]]'));
|
||||
}
|
||||
function (next) {
|
||||
Messaging.editMessage(socket.uid, data.mid, data.roomId, data.message, next);
|
||||
},
|
||||
], callback);
|
||||
@@ -262,13 +259,9 @@ SocketModules.chats.delete = function (socket, data, callback) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Messaging.canEdit(data.messageId, socket.uid, next);
|
||||
Messaging.canDelete(data.messageId, socket.uid, next);
|
||||
},
|
||||
function (allowed, next) {
|
||||
if (!allowed) {
|
||||
return next(new Error('[[error:cant-delete-chat-message]]'));
|
||||
}
|
||||
|
||||
function (next) {
|
||||
Messaging.deleteMessage(data.messageId, data.roomId, next);
|
||||
},
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user