remove contact when we get sub=none and ask=none and no name and no group. See #1494
This commit is contained in:
parent
f95a7c5d3e
commit
4f2460e21c
1 changed files with 11 additions and 6 deletions
17
src/gajim.py
17
src/gajim.py
|
@ -899,20 +899,25 @@ class Interface:
|
||||||
if not jid in gajim.contacts.get_jid_list(account):
|
if not jid in gajim.contacts.get_jid_list(account):
|
||||||
return
|
return
|
||||||
contacts = gajim.contacts.get_contacts_from_jid(account, jid)
|
contacts = gajim.contacts.get_contacts_from_jid(account, jid)
|
||||||
if not (array[2] or array[3]):
|
# contact removes us.
|
||||||
|
name = array[1]
|
||||||
|
sub = array[2]
|
||||||
|
ask = array[3]
|
||||||
|
groups = array[4]
|
||||||
|
if (not sub or sub == 'none') and (not ask or ask == 'none') and \
|
||||||
|
not name and not groups:
|
||||||
self.roster.remove_contact(contacts[0], account)
|
self.roster.remove_contact(contacts[0], account)
|
||||||
gajim.contacts.remove_jid(account, jid)
|
gajim.contacts.remove_jid(account, jid)
|
||||||
#FIXME if it was the only one in its group, remove the group
|
#FIXME if it was the only one in its group, remove the group
|
||||||
return
|
return
|
||||||
for contact in contacts:
|
for contact in contacts:
|
||||||
name = array[1]
|
|
||||||
if not name:
|
if not name:
|
||||||
name = ''
|
name = ''
|
||||||
contact.name = name
|
contact.name = name
|
||||||
contact.sub = array[2]
|
contact.sub = sub
|
||||||
contact.ask = array[3]
|
contact.ask = ask
|
||||||
if array[4]:
|
if groups:
|
||||||
contact.groups = array[4]
|
contact.groups = groups
|
||||||
self.roster.draw_contact(jid, account)
|
self.roster.draw_contact(jid, account)
|
||||||
if self.remote_ctrl:
|
if self.remote_ctrl:
|
||||||
self.remote_ctrl.raise_signal('RosterInfo', (account, array))
|
self.remote_ctrl.raise_signal('RosterInfo', (account, array))
|
||||||
|
|
Loading…
Add table
Reference in a new issue