Philipp Hörist pushed to branch master at gajim / gajim
Commits:
29cf416d by Philipp Hörist at 2017-10-15T21:34:32+02:00
Send Presence probe on unblock
- - - - -
03e32668 by Philipp Hörist at 2017-10-15T21:34:42+02:00
MUC: Hide block menu if privacy list is absent
- - - - -
ed764789 by Philipp Hörist at 2017-10-15T21:34:42+02:00
Show blocked contacts as offline
- - - - -
3 changed files:
- gajim/common/connection.py
- gajim/common/connection_handlers.py
- gajim/groupchat_control.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1639,6 +1639,7 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection.send(iq)
return
for contact in contact_list:
+ contact.show = 'offline'
self.send_custom_status('offline', message, contact.jid)
max_order = self.get_max_blocked_list_order()
new_rule = {'order': str(max_order + 1),
@@ -1687,6 +1688,9 @@ class Connection(CommonConnection, ConnectionHandlers):
return
for contact in contact_list:
self.send_custom_status(show, self.status, contact.jid)
+ # Send a presence Probe to get the current Status
+ probe = nbxmpp.Presence(contact.jid, 'probe',
frm=self.get_own_jid())
+ self.connection.send(probe)
def block_group(self, group, contact_list, message):
if not self.privacy_rules_supported:
=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -2104,9 +2104,15 @@ ConnectionHandlersBase, ConnectionJingle,
ConnectionIBBytestream):
for jid in obj.blocked_jids:
if jid not in self.blocked_contacts:
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:
if jid in self.blocked_contacts:
self.blocked_contacts.remove(jid)
+ # Send a presence Probe to get the current Status
+ probe = nbxmpp.Presence(jid, 'probe', frm=self.get_own_jid())
+ self.connection.send(probe)
def _nec_stream_other_host_received(self, obj):
if obj.conn.name != self.name:
=====================================
gajim/groupchat_control.py
=====================================
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -2613,7 +2613,12 @@ class GroupchatControl(ChatControlBase):
item = xml.get_object('block_menuitem')
item2 = xml.get_object('unblock_menuitem')
- if helpers.jid_is_blocked(self.account, fjid):
+ if not app.connections[self.account].privacy_rules_supported:
+ item2.set_no_show_all(True)
+ item.set_no_show_all(True)
+ item.hide()
+ item2.hide()
+ elif helpers.jid_is_blocked(self.account, fjid):
item.set_no_show_all(True)
item.hide()
id_ = item2.connect('activate', self.on_unblock, nick)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/2446c7e3ed969e0426e4dae446fffd27a983de9d...ed764789f132c61bbab1cca1cbd4065649f97d2a
---
View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/2446c7e3ed969e0426e4dae446fffd27a983de9d...ed764789f132c61bbab1cca1cbd4065649f97d2a
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits