Commit a4475a54 authored by JC Brand's avatar JC Brand

Stop using strophe.roster in unsubscribe method.

parent 7f8da771
...@@ -3538,6 +3538,7 @@ ...@@ -3538,6 +3538,7 @@
.c('query', {xmlns: Strophe.NS.ROSTER}) .c('query', {xmlns: Strophe.NS.ROSTER})
.c('item', {jid: this.get('jid'), subscription: "remove"}); .c('item', {jid: this.get('jid'), subscription: "remove"});
converse.connection.sendIQ(iq, callback, callback); converse.connection.sendIQ(iq, callback, callback);
return this;
}, },
showInRoster: function () { showInRoster: function () {
...@@ -3837,13 +3838,11 @@ ...@@ -3837,13 +3838,11 @@
* notification by sending a presence stanza of type "unsubscribe" * notification by sending a presence stanza of type "unsubscribe"
* this step lets the user's server know that it MUST no longer * this step lets the user's server know that it MUST no longer
* send notification of the subscription state change to the user. * send notification of the subscription state change to the user.
* Parameters:
* (String) jid - The Jabber ID of the user who is unsubscribing
*/ */
converse.xmppstatus.sendPresence('unsubscribe'); converse.xmppstatus.sendPresence('unsubscribe');
if (converse.connection.roster.findItem(jid)) { this.get(bare_jid).destroy(); // Will cause removeFromRoster to be called.
converse.connection.roster.remove(jid, function (iq) {
converse.rosterview.model.remove(jid);
});
}
}, },
getNumOnlineContacts: function () { getNumOnlineContacts: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment