mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
only allow users in the room to get raw message content
This commit is contained in:
@@ -64,7 +64,7 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
|
||||
.on('click', '[data-action="edit"]', function() {
|
||||
var messageId = $(this).parents('[data-mid]').attr('data-mid');
|
||||
var inputEl = components.get('chat/input');
|
||||
Chats.prepEdit(inputEl, messageId);
|
||||
Chats.prepEdit(inputEl, messageId, ajaxify.data.roomId);
|
||||
})
|
||||
.on('click', '[data-action="delete"]', function() {
|
||||
var messageId = $(this).parents('[data-mid]').attr('data-mid');
|
||||
@@ -106,13 +106,13 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
|
||||
var lastMid = message.attr('data-mid');
|
||||
var inputEl = components.get('chat/input');
|
||||
|
||||
Chats.prepEdit(inputEl, lastMid);
|
||||
Chats.prepEdit(inputEl, lastMid, ajaxify.data.roomId);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Chats.prepEdit = function(inputEl, messageId) {
|
||||
socket.emit('modules.chats.getRaw', { mid: messageId }, function(err, raw) {
|
||||
Chats.prepEdit = function(inputEl, messageId, roomId) {
|
||||
socket.emit('modules.chats.getRaw', { mid: messageId, roomId: roomId }, function(err, raw) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user