From b0a37c6ac5a16ef3d6de45d3c134795503734b8e Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sat, 14 Sep 2013 22:04:03 -0400 Subject: [PATCH] closes #293 --- public/src/modules/chat.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 3c67a6e170..4391b58cfc 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -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,11 +77,8 @@ define(['taskbar'], function(taskbar) { addSendHandler(chatModal); - checkStatus(chatModal, function(online) { - chatModal.online = online; - getChatMessages(chatModal, function() { - checkOnlineStatus(chatModal); - }); + getChatMessages(chatModal, function() { + checkOnlineStatus(chatModal); }); taskbar.push('chat', chatModal.attr('UUID'), {title:'chat with ' + username});