v1.18.x
barisusakli 9 years ago
parent 97c42de2d3
commit 5e86d9f804

@ -380,8 +380,15 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
app.updateUserStatus($('.chats-list [data-uid="' + data.uid + '"] [component="user/status"]'), data.status);
});
socket.on('event:chats.edit', function(data) {
Chats.onChatEdit();
socket.on('event:chats.roomRename', function(data) {
$('[component="chat/room/name"]').val(data.newName);
});
};
Chats.onChatEdit = function() {
socket.on('event:chats.edit', function(data) {
data.messages.forEach(function(message) {
templates.parse('partials/chat_message', {
messages: message
@ -394,10 +401,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
});
});
});
socket.on('event:chats.roomRename', function(data) {
$('[component="chat/room/name"]').val(data.newName);
});
};
Chats.resizeMainWindow = function() {

@ -92,6 +92,8 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
socket.on('event:chats.roomRename', function(data) {
module.getModal(data.roomId).find('[component="chat/room/name"]').val(data.newName);
});
Chats.onChatEdit();
};
module.loadChatsDropdown = function(chatsListEl) {

Loading…
Cancel
Save