Commit 93a20ee4 authored by JC Brand's avatar JC Brand

Make sure removeFromRoster is called only once

parent b584f2ef
......@@ -887,7 +887,6 @@
'user_id': Strophe.getNodeFromJid(jid)
}, attributes));
this.on('destroy', () => { this.removeFromRoster(); });
this.on('change:chat_status', function (item) {
_converse.emit('contactStatusChanged', item.attributes);
});
......@@ -935,7 +934,8 @@
* (String) jid - The Jabber ID of the user who is unsubscribing
*/
_converse.connection.send($pres({'type': 'unsubscribe', 'to': this.get('jid')}));
this.destroy(); // Will cause removeFromRoster to be called.
this.removeFromRoster();
this.destroy();
},
unauthorize (message) {
......@@ -1320,7 +1320,7 @@
}, {sort: false});
} else {
if (subscription === "remove") {
return contact.destroy(); // will trigger removeFromRoster
return contact.destroy();
}
// We only find out about requesting contacts via the
// presence handler, so if we receive a contact
......
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