mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
closes #4299
This commit is contained in:
@@ -376,7 +376,7 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
|
|||||||
Chats.onChatEdit();
|
Chats.onChatEdit();
|
||||||
|
|
||||||
socket.on('event:chats.roomRename', function(data) {
|
socket.on('event:chats.roomRename', function(data) {
|
||||||
$('[component="chat/room/name"]').val(data.newName);
|
$('[component="chat/room/name"]').val($('<div/>').html(data.newName).text());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('event:chats.roomRename', function(data) {
|
socket.on('event:chats.roomRename', function(data) {
|
||||||
module.getModal(data.roomId).find('[component="chat/room/name"]').val(data.newName);
|
module.getModal(data.roomId).find('[component="chat/room/name"]').val($('<div/>').html(data.newName).text());
|
||||||
});
|
});
|
||||||
|
|
||||||
Chats.onChatEdit();
|
Chats.onChatEdit();
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ module.exports = function(Messaging) {
|
|||||||
if (!newName) {
|
if (!newName) {
|
||||||
return callback(new Error('[[error:invalid-name]]'));
|
return callback(new Error('[[error:invalid-name]]'));
|
||||||
}
|
}
|
||||||
|
newName = newName.trim();
|
||||||
|
if (newName.length > 75) {
|
||||||
|
return callback(new Error('[[error:chat-room-name-too-long]]'));
|
||||||
|
}
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
Messaging.isRoomOwner(uid, roomId, next);
|
Messaging.isRoomOwner(uid, roomId, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user