From 9dc5757e9ba537344cc6e7c468af13ab5a334f43 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 27 Jan 2014 15:12:46 -0800 Subject: [PATCH] Refresh roster cache correctly (anytime there's a roster result with items). --- clientapp/helpers/xmppEventHandlers.js | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clientapp/helpers/xmppEventHandlers.js b/clientapp/helpers/xmppEventHandlers.js index eef0d29..aa40ff2 100644 --- a/clientapp/helpers/xmppEventHandlers.js +++ b/clientapp/helpers/xmppEventHandlers.js @@ -114,8 +114,7 @@ module.exports = function (client, app) { client.getRoster(function (err, resp) { resp = resp.toJSON(); - var resultVer = resp.roster.ver; - if (me.rosterVer && resultVer && me.rosterVer !== resultVer) { + if (resp.roster && resp.roster.items && resp.roster.items.length) { app.storage.roster.clear(function () { me.contacts.reset(); me.rosterVer = resp.roster.ver; diff --git a/package.json b/package.json index ce81382..e4d91df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "otalk.im", - "version": "0.0.23", + "version": "0.0.24", "description": "Otalk: WebRTC Enabled XMPP Client, in the Browser", "repository": { "type": "git",