Commit 25b933e2 authored by Philipp Hörist's avatar Philipp Hörist

Dont try to set empty privacy default list

This will result in a conflict stanza because an active
default list cant be deleted

Decline the use of default list first, then delete the list
parent 63335357
......@@ -1797,7 +1797,6 @@ class Connection(CommonConnection, ConnectionHandlers):
if rule['action'] != 'deny' or rule['type'] != 'jid' \
or rule['value'] not in self.to_unblock:
self.new_blocked_list.append(rule)
self.set_privacy_list(self.privacy_default_list, self.new_blocked_list)
if len(self.new_blocked_list) == 0:
self.blocked_list = []
self.blocked_contacts = []
......@@ -1805,6 +1804,8 @@ class Connection(CommonConnection, ConnectionHandlers):
self.set_default_list('')
self.set_active_list('')
self.del_privacy_list(self.privacy_default_list)
else:
self.set_privacy_list(self.privacy_default_list, self.new_blocked_list)
if not gajim.interface.roster.regroup:
show = gajim.SHOW_LIST[self.connected]
else: # accounts merged
......@@ -1841,7 +1842,6 @@ class Connection(CommonConnection, ConnectionHandlers):
if rule['action'] != 'deny' or rule['type'] != 'group' or \
rule['value'] != group:
self.new_blocked_list.append(rule)
self.set_privacy_list(self.privacy_default_list, self.new_blocked_list)
if len(self.new_blocked_list) == 0:
self.blocked_list = []
self.blocked_contacts = []
......@@ -1849,6 +1849,8 @@ class Connection(CommonConnection, ConnectionHandlers):
self.set_default_list('')
self.set_active_list('')
self.del_privacy_list(self.privacy_default_list)
else:
self.set_privacy_list(self.privacy_default_list, self.new_blocked_list)
if not gajim.interface.roster.regroup:
show = gajim.SHOW_LIST[self.connected]
else: # accounts merged
......
......@@ -2798,7 +2798,6 @@ class GroupchatControl(ChatControlBase):
or rule['value'] != fjid:
connection.new_blocked_list.append(rule)
connection.set_privacy_list(default, connection.new_blocked_list)
if len(connection.new_blocked_list) == 0:
connection.blocked_list = []
connection.blocked_contacts = []
......@@ -2809,6 +2808,8 @@ class GroupchatControl(ChatControlBase):
if 'privay_list_block' in gajim.interface.instances[self.account]:
del gajim.interface.instances[self.account]\
['privay_list_block']
else:
connection.set_privacy_list(default, connection.new_blocked_list)
def on_voice_checkmenuitem_activate(self, widget, nick):
if widget.get_active():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment