Do not always force backend removal when performing a delayed remove operation. Some coding standards.

This commit is contained in:
Stephan Erb 2008-09-01 20:25:50 +00:00
parent 96a826ed7e
commit 2a1d6edd68
2 changed files with 11 additions and 8 deletions

View File

@ -961,7 +961,8 @@ class Interface:
if jid in gajim.contacts.get_jid_list(account):
c = gajim.contacts.get_first_contact_from_jid(account, jid)
c.resource = array[1]
self.roster.remove_contact_from_groups(c.jid, account, [('Not in Roster'),])
self.roster.remove_contact_from_groups(c.jid, account,
[('Not in Roster'),])
else:
keyID = ''
attached_keys = gajim.config.get_per('accounts', account,
@ -1493,7 +1494,8 @@ class Interface:
# according to xep 0162, contact is not an observer anymore when
# we asked him is auth, so also remove him if ask changed
old_groups = contacts[0].get_shown_groups()
if contacts[0].sub != sub or contacts[0].ask != ask or old_groups != groups:
if contacts[0].sub != sub or contacts[0].ask != ask\
or old_groups != groups:
self.roster.remove_contact(jid, account)
re_add = True
for contact in contacts:

View File

@ -1775,9 +1775,10 @@ class RosterWindow:
# Remove contacts in roster if removal was requested
key = (jid, account)
if key in self.contacts_to_be_removed.keys():
backend = self.contacts_to_be_removed[key]['backend']
del self.contacts_to_be_removed[key]
# Remove contact will delay removal if there are more events pending
self.remove_contact(jid, account, backend=True)
self.remove_contact(jid, account, backend=backend)
self.show_title()
def open_event(self, account, jid, event):