commiting a patch by Srid to remove contacts on removing transport
This commit is contained in:
parent
051adcab4d
commit
f66a2bcb63
1 changed files with 8 additions and 1 deletions
|
@ -446,11 +446,18 @@ class Roster_window:
|
||||||
|
|
||||||
def on_remove_agent(self, widget, user, account):
|
def on_remove_agent(self, widget, user, account):
|
||||||
'''When an agent is requested to log in or off'''
|
'''When an agent is requested to log in or off'''
|
||||||
window = dialogs.Confirmation_dialog(_('Are you sure you want to remove %s transport from your roster?') % user.jid)
|
window = dialogs.Confirmation_dialog(_('Are you sure you want to unregister from "%s" transport?\nContacts from that transport will also be removed') % user.jid)
|
||||||
if window.get_response() == gtk.RESPONSE_YES:
|
if window.get_response() == gtk.RESPONSE_YES:
|
||||||
gajim.connections[account].unsubscribe_agent(user.jid + '/' \
|
gajim.connections[account].unsubscribe_agent(user.jid + '/' \
|
||||||
+ user.resource)
|
+ user.resource)
|
||||||
|
# remove transport from listview
|
||||||
self.remove_user(user, account)
|
self.remove_user(user, account)
|
||||||
|
# remove transport's contacts from listview
|
||||||
|
for jid, contacts in self.contacts[account].items():
|
||||||
|
contact = contacts[0]
|
||||||
|
if jid.endswith('@' + user.jid):
|
||||||
|
gajim.log.debug('REMOVE user %s due to unregistered transport %s' % (contact.jid, user.name))
|
||||||
|
self.remove_user(contact, account)
|
||||||
del self.contacts[account][user.jid]
|
del self.contacts[account][user.jid]
|
||||||
|
|
||||||
def on_rename(self, widget, iter, path):
|
def on_rename(self, widget, iter, path):
|
||||||
|
|
Loading…
Add table
Reference in a new issue