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) {
if(data.online !== chatModal.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 {
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;
}
@ -38,7 +38,7 @@ define(['taskbar'], function(taskbar) {
function checkOnlineStatus(chatModal) {
if(chatModal.intervalId === 0) {
chatModal.intervalId = setInterval(function(){
chatModal.intervalId = setInterval(function() {
checkStatus(chatModal);
}, 1000);
}
@ -77,12 +77,9 @@ define(['taskbar'], function(taskbar) {
addSendHandler(chatModal);
checkStatus(chatModal, function(online) {
chatModal.online = online;
getChatMessages(chatModal, function() {
checkOnlineStatus(chatModal);
});
});
taskbar.push('chat', chatModal.attr('UUID'), {title:'chat with ' + username});
return chatModal;

Loading…
Cancel
Save