User wasn't being removed from the roster if their buddy unsubscribed.
This commit is contained in:
JC Brand 2013-03-15 07:12:08 +02:00
parent 15093e7795
commit 7f26ddbee6

View File

@ -1279,11 +1279,6 @@
$(this).dialog( "close" ); $(this).dialog( "close" );
xmppchat.connection.roster.remove(bare_jid, function (iq) { xmppchat.connection.roster.remove(bare_jid, function (iq) {
xmppchat.connection.roster.unauthorize(bare_jid); xmppchat.connection.roster.unauthorize(bare_jid);
// TODO inspect if chatboxes ever receives controlbox
if (xmppchat.chatboxesview.controlbox) {
xmppchat.chatboxesview.controlbox.roster.remove(bare_jid);
}
// remove model from view roster
xmppchat.rosterview.model.remove(bare_jid); xmppchat.rosterview.model.remove(bare_jid);
}); });
}, },
@ -1569,11 +1564,11 @@
* 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.
*/ */
// TODO see if xmppstatus is truly unresolved
xmppchat.xmppstatus.sendPresence('unsubscribe'); xmppchat.xmppstatus.sendPresence('unsubscribe');
if (xmppchat.connection.roster.findItem(bare_jid)) { if (xmppchat.connection.roster.findItem(bare_jid)) {
xmppchat.chatboxesview.controlbox.roster.remove(bare_jid); xmppchat.connection.roster.remove(bare_jid, function (iq) {
xmppchat.connection.roster.remove(bare_jid); xmppchat.rosterview.model.remove(bare_jid);
});
} }
} else { } else {
if ((presence_type === undefined) && (show)) { if ((presence_type === undefined) && (show)) {