v1.18.x
Baris Soner Usakli 12 years ago
parent 8b3fd9d1e9
commit b0a37c6ac5

@ -25,9 +25,9 @@ define(['taskbar'], function(taskbar) {
socket.emit('api:user.isOnline', chatModal.touid, function(data) { socket.emit('api:user.isOnline', chatModal.touid, function(data) {
if(data.online !== chatModal.online) { if(data.online !== chatModal.online) {
if(data.online) { if(data.online) {
module.appendChatMessage(chatModal, chatModal.username + ' has come online.\n', data.timestamp); module.appendChatMessage(chatModal, chatModal.username + ' is currently online.\n', data.timestamp);
} else { } else {
module.appendChatMessage(chatModal, chatModal.username + ' has gone offline.\n', data.timestamp); module.appendChatMessage(chatModal, chatModal.username + ' is currently offline.\n', data.timestamp);
} }
chatModal.online = data.online; chatModal.online = data.online;
} }
@ -38,7 +38,7 @@ define(['taskbar'], function(taskbar) {
function checkOnlineStatus(chatModal) { function checkOnlineStatus(chatModal) {
if(chatModal.intervalId === 0) { if(chatModal.intervalId === 0) {
chatModal.intervalId = setInterval(function(){ chatModal.intervalId = setInterval(function() {
checkStatus(chatModal); checkStatus(chatModal);
}, 1000); }, 1000);
} }
@ -77,11 +77,8 @@ define(['taskbar'], function(taskbar) {
addSendHandler(chatModal); addSendHandler(chatModal);
checkStatus(chatModal, function(online) { getChatMessages(chatModal, function() {
chatModal.online = online; checkOnlineStatus(chatModal);
getChatMessages(chatModal, function() {
checkOnlineStatus(chatModal);
});
}); });
taskbar.push('chat', chatModal.attr('UUID'), {title:'chat with ' + username}); taskbar.push('chat', chatModal.attr('UUID'), {title:'chat with ' + username});

Loading…
Cancel
Save