Show blocked contacts as offline

This commit is contained in:
Philipp Hörist 2017-10-15 21:32:16 +02:00
parent 03e326688d
commit ed764789f1
2 changed files with 4 additions and 0 deletions

View File

@ -1639,6 +1639,7 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection.send(iq) self.connection.send(iq)
return return
for contact in contact_list: for contact in contact_list:
contact.show = 'offline'
self.send_custom_status('offline', message, contact.jid) self.send_custom_status('offline', message, contact.jid)
max_order = self.get_max_blocked_list_order() max_order = self.get_max_blocked_list_order()
new_rule = {'order': str(max_order + 1), new_rule = {'order': str(max_order + 1),

View File

@ -2104,6 +2104,9 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream):
for jid in obj.blocked_jids: for jid in obj.blocked_jids:
if jid not in self.blocked_contacts: if jid not in self.blocked_contacts:
self.blocked_contacts.append(jid) self.blocked_contacts.append(jid)
contact_list = app.contacts.get_contacts(self.name, jid)
for contact in contact_list:
contact.show = 'offline'
for jid in obj.unblocked_jids: for jid in obj.unblocked_jids:
if jid in self.blocked_contacts: if jid in self.blocked_contacts:
self.blocked_contacts.remove(jid) self.blocked_contacts.remove(jid)