From b304a54afe98382c055e406292d8f3a65b93077d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sat, 14 Jul 2012 06:46:46 +0200 Subject: [PATCH] Show the number of online users. --- chat.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/chat.js b/chat.js index b6ae5a7e7..382664c24 100644 --- a/chat.js +++ b/chat.js @@ -24,6 +24,7 @@ var xmppchat = (function (jarnxmpp, $, console) { ob.Presence = jarnxmpp.Presence || {}; ob.Messages.ClientStorage = (function () { + // TODO: Messages must be encrypted with a key and salt methods = {}; methods.addMessage = function (jid, msg, direction) { @@ -86,14 +87,6 @@ var xmppchat = (function (jarnxmpp, $, console) { }); }; - ob.Presence.getOwnStatus = function () { - return xmppchat.Storage.get(xmppchat.username+'-xmpp-status'); - }; - - ob.Presence.onlineCount = function () { - return xmppchat.ChatPartners.getTotal(); - }; - ob.Taskbuffer = (function ($) { // Executes tasks one after another (i.e next task is started only when // the previous one has been completed). @@ -723,6 +716,16 @@ xmppchat.RosterClass = (function (stropheRoster, _, $, console) { if (item) { return _.size(item.get('resources')); } + }, + + getNumOnlineContacts: function () { + var count = 0; + for (var i=0; i