mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
removed api: from client side socket calls
This commit is contained in:
@@ -13,7 +13,7 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('api:modules.chats.list', function(chats) {
|
||||
socket.emit('modules.chats.list', function(chats) {
|
||||
var chatsFrag = document.createDocumentFragment(),
|
||||
chatEl = document.createElement('li'),
|
||||
numChats = chats.length,
|
||||
@@ -90,7 +90,7 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
||||
}
|
||||
|
||||
function checkStatus(chatModal, callback) {
|
||||
socket.emit('api:user.isOnline', chatModal.touid, function(data) {
|
||||
socket.emit('user.isOnline', chatModal.touid, function(data) {
|
||||
if(data.online !== chatModal.online) {
|
||||
if(data.online) {
|
||||
module.appendChatMessage(chatModal, chatModal.username + ' is currently online.\n', data.timestamp);
|
||||
@@ -191,7 +191,7 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
||||
}
|
||||
|
||||
function getChatMessages(chatModal, callback) {
|
||||
socket.emit('api:modules.chats.get', {touid:chatModal.touid}, function(messages) {
|
||||
socket.emit('modules.chats.get', {touid:chatModal.touid}, function(messages) {
|
||||
for(var i = 0; i<messages.length; ++i) {
|
||||
module.appendChatMessage(chatModal, messages[i].content, messages[i].timestamp);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
||||
var msg = S(chatModal.find('#chat-message-input').val()).stripTags().s;
|
||||
if(msg.length) {
|
||||
msg = msg +'\n';
|
||||
socket.emit('api:modules.chats.send', { touid:chatModal.touid, message:msg});
|
||||
socket.emit('modules.chats.send', { touid:chatModal.touid, message:msg});
|
||||
chatModal.find('#chat-message-input').val('');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user