support XEP-0016 (privacy lists) "block all" feature. Fixes #4552
This commit is contained in:
parent
43f87899f8
commit
2472a9556d
|
@ -165,6 +165,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
<property name="padding">5</property>
|
<property name="padding">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -422,6 +423,19 @@ to</property>
|
||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="edit_all_checkbutton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">All (including subscription)</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
<signal name="toggled" handler="on_edit_all_checkbutton_toggled"/>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="position">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
|
|
|
@ -3075,11 +3075,11 @@ class PrivacyListWindow:
|
||||||
'edit_type_group_combobox', 'edit_type_subscription_radiobutton',
|
'edit_type_group_combobox', 'edit_type_subscription_radiobutton',
|
||||||
'edit_type_subscription_combobox', 'edit_type_select_all_radiobutton',
|
'edit_type_subscription_combobox', 'edit_type_select_all_radiobutton',
|
||||||
'edit_queries_send_checkbutton', 'edit_send_messages_checkbutton',
|
'edit_queries_send_checkbutton', 'edit_send_messages_checkbutton',
|
||||||
'edit_view_status_checkbutton', 'edit_order_spinbutton',
|
'edit_view_status_checkbutton', 'edit_all_checkbutton',
|
||||||
'new_rule_button', 'save_rule_button', 'privacy_list_refresh_button',
|
'edit_order_spinbutton', 'new_rule_button', 'save_rule_button',
|
||||||
'privacy_list_close_button', 'edit_send_status_checkbutton',
|
'privacy_list_refresh_button', 'privacy_list_close_button',
|
||||||
'add_edit_vbox', 'privacy_list_active_checkbutton',
|
'edit_send_status_checkbutton', 'add_edit_vbox',
|
||||||
'privacy_list_default_checkbutton'):
|
'privacy_list_active_checkbutton', 'privacy_list_default_checkbutton'):
|
||||||
self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add)
|
self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add)
|
||||||
|
|
||||||
self.privacy_lists_title_label.set_label(
|
self.privacy_lists_title_label.set_label(
|
||||||
|
@ -3230,14 +3230,17 @@ class PrivacyListWindow:
|
||||||
self.edit_queries_send_checkbutton.set_active(False)
|
self.edit_queries_send_checkbutton.set_active(False)
|
||||||
self.edit_view_status_checkbutton.set_active(False)
|
self.edit_view_status_checkbutton.set_active(False)
|
||||||
self.edit_send_status_checkbutton.set_active(False)
|
self.edit_send_status_checkbutton.set_active(False)
|
||||||
for child in rule_info['child']:
|
self.edit_all_checkbutton.set_active(False)
|
||||||
if child == 'presence-out':
|
if not rule_info['child']:
|
||||||
|
self.edit_all_checkbutton.set_active(True)
|
||||||
|
else:
|
||||||
|
if 'presence-out' in rule_info['child']:
|
||||||
self.edit_send_status_checkbutton.set_active(True)
|
self.edit_send_status_checkbutton.set_active(True)
|
||||||
elif child == 'presence-in':
|
if 'presence-in' in rule_info['child']:
|
||||||
self.edit_view_status_checkbutton.set_active(True)
|
self.edit_view_status_checkbutton.set_active(True)
|
||||||
elif child == 'iq':
|
if 'iq' in rule_info['child']:
|
||||||
self.edit_queries_send_checkbutton.set_active(True)
|
self.edit_queries_send_checkbutton.set_active(True)
|
||||||
elif child == 'message':
|
if 'message' in rule_info['child']:
|
||||||
self.edit_send_messages_checkbutton.set_active(True)
|
self.edit_send_messages_checkbutton.set_active(True)
|
||||||
|
|
||||||
if rule_info['action'] == 'allow':
|
if rule_info['action'] == 'allow':
|
||||||
|
@ -3246,6 +3249,26 @@ class PrivacyListWindow:
|
||||||
self.edit_deny_radiobutton.set_active(True)
|
self.edit_deny_radiobutton.set_active(True)
|
||||||
self.add_edit_vbox.show()
|
self.add_edit_vbox.show()
|
||||||
|
|
||||||
|
def on_edit_all_checkbutton_toggled(self, widget):
|
||||||
|
if widget.get_active():
|
||||||
|
self.edit_send_messages_checkbutton.set_active(True)
|
||||||
|
self.edit_queries_send_checkbutton.set_active(True)
|
||||||
|
self.edit_view_status_checkbutton.set_active(True)
|
||||||
|
self.edit_send_status_checkbutton.set_active(True)
|
||||||
|
self.edit_send_messages_checkbutton.set_sensitive(False)
|
||||||
|
self.edit_queries_send_checkbutton.set_sensitive(False)
|
||||||
|
self.edit_view_status_checkbutton.set_sensitive(False)
|
||||||
|
self.edit_send_status_checkbutton.set_sensitive(False)
|
||||||
|
else:
|
||||||
|
self.edit_send_messages_checkbutton.set_active(False)
|
||||||
|
self.edit_queries_send_checkbutton.set_active(False)
|
||||||
|
self.edit_view_status_checkbutton.set_active(False)
|
||||||
|
self.edit_send_status_checkbutton.set_active(False)
|
||||||
|
self.edit_send_messages_checkbutton.set_sensitive(True)
|
||||||
|
self.edit_queries_send_checkbutton.set_sensitive(True)
|
||||||
|
self.edit_view_status_checkbutton.set_sensitive(True)
|
||||||
|
self.edit_send_status_checkbutton.set_sensitive(True)
|
||||||
|
|
||||||
def on_privacy_list_active_checkbutton_toggled(self, widget):
|
def on_privacy_list_active_checkbutton_toggled(self, widget):
|
||||||
if widget.get_active():
|
if widget.get_active():
|
||||||
gajim.connections[self.account].set_active_list(
|
gajim.connections[self.account].set_active_list(
|
||||||
|
@ -3273,6 +3296,7 @@ class PrivacyListWindow:
|
||||||
self.edit_queries_send_checkbutton.set_active(False)
|
self.edit_queries_send_checkbutton.set_active(False)
|
||||||
self.edit_view_status_checkbutton.set_active(False)
|
self.edit_view_status_checkbutton.set_active(False)
|
||||||
self.edit_send_status_checkbutton.set_active(False)
|
self.edit_send_status_checkbutton.set_active(False)
|
||||||
|
self.edit_all_checkbutton.set_active(False)
|
||||||
self.edit_order_spinbutton.set_value(1)
|
self.edit_order_spinbutton.set_value(1)
|
||||||
self.edit_type_group_combobox.set_active(0)
|
self.edit_type_group_combobox.set_active(0)
|
||||||
self.edit_type_subscription_combobox.set_active(0)
|
self.edit_type_subscription_combobox.set_active(0)
|
||||||
|
@ -3299,6 +3323,7 @@ class PrivacyListWindow:
|
||||||
else:
|
else:
|
||||||
edit_deny = 'deny'
|
edit_deny = 'deny'
|
||||||
child = []
|
child = []
|
||||||
|
if not self.edit_all_checkbutton.get_active():
|
||||||
if self.edit_send_messages_checkbutton.get_active():
|
if self.edit_send_messages_checkbutton.get_active():
|
||||||
child.append('message')
|
child.append('message')
|
||||||
if self.edit_queries_send_checkbutton.get_active():
|
if self.edit_queries_send_checkbutton.get_active():
|
||||||
|
|
Loading…
Reference in New Issue