From d1618300a3c423347a0b170708141e0316fe3d11 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 10 May 2013 10:58:25 +0200 Subject: [PATCH] Make sure fullname is saved to localStorage Also make sure that logged in user's fullname is fetched from xmppstatus obj. --- converse.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/converse.js b/converse.js index c00647f73..39459f0d3 100644 --- a/converse.js +++ b/converse.js @@ -673,7 +673,7 @@ addContact: function (jid, name) { converse.connection.roster.add(jid, name, [], function (iq) { - converse.connection.roster.subscribe(jid, null, converse.fullname); + converse.connection.roster.subscribe(jid, null, converse.xmppstatus.get('fullname')); }); } }); @@ -1301,7 +1301,7 @@ var jid = this.model.get('jid'); converse.connection.roster.authorize(jid); converse.connection.roster.add(jid, this.model.get('fullname'), [], function (iq) { - converse.connection.roster.subscribe(jid, null, converse.fullname); + converse.connection.roster.subscribe(jid, null, converse.xmppstatus.get('fullname')); }); ev.preventDefault(); }, @@ -1404,7 +1404,7 @@ fullname = $this.attr('name'); if (action === 'add') { converse.connection.roster.add(jid, fullname, [], function (iq) { - converse.connection.roster.subscribe(jid, null, converse.fullname); + converse.connection.roster.subscribe(jid, null, converse.xmppstatus.get('fullname')); }); } }); @@ -1455,11 +1455,11 @@ var bare_jid = Strophe.getBareJidFromJid(jid); if (converse.connection.roster.findItem(bare_jid)) { converse.connection.roster.authorize(bare_jid); - converse.connection.roster.subscribe(jid, null, converse.fullname); + converse.connection.roster.subscribe(jid, null, converse.xmppstatus.get('fullname')); } else { converse.connection.roster.add(jid, '', [], function (iq) { converse.connection.roster.authorize(bare_jid); - converse.connection.roster.subscribe(jid, null, converse.fullname); + converse.connection.roster.subscribe(jid, null, converse.xmppstatus.get('fullname')); }); } }, @@ -1753,7 +1753,8 @@ initialize: function () { this.set({ 'status' : this.get('status'), - 'status_message' : this.get('status_message') + 'status_message' : this.get('status_message'), + 'fullname' : this.get('fullname') }); }, @@ -2138,7 +2139,7 @@ this.getVCard( null, // No 'to' attr when getting one's own vCard $.proxy(function (jid, fullname, image, image_type, url) { - this.xmppstatus.set({'fullname': fullname}); + this.xmppstatus.save({'fullname': fullname}); }, this)); } }, this)