From 09aa41a4dfeeed430a361c849297d97ae1bf751c Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 26 Apr 2007 19:46:13 +0000 Subject: [PATCH] draw blocked groups striked --- src/roster_window.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 3e6422354..0df369cdb 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -392,13 +392,15 @@ class RosterWindow: accounts = [] else: accounts = [account] - text = group + text = gobject.markup_escape_text(group) + if group in gajim.connections[account].blocked_groups: + text = '%s' % text if gajim.config.get('show_contacts_number'): nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts( accounts = accounts, groups = [group]) text += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total)) model = self.tree.get_model() - model.set_value(iter, 1 , gobject.markup_escape_text(text)) + model.set_value(iter, 1 , text) def add_to_not_in_the_roster(self, account, jid, nick = '', resource = ''): ''' add jid to group "not in the roster", he MUST not be in roster yet, @@ -1462,19 +1464,18 @@ class RosterWindow: self.draw_contact(contact.jid, account) else: group = model[iter][C_JID].decode('utf-8') - msg = self.get_status_message('offline') for (contact, account) in group_list: if account not in accounts: if not gajim.connections[account].privacy_rules_supported: continue accounts.append(account) self.send_status(account, 'offline', msg, to=contact.jid) - # needed for draw_contact: - gajim.connections[account].blocked_contacts.append(contact.jid) - self.draw_contact(contact.jid, account) new_rule = {'order': u'1', 'type': u'group', 'action': u'deny', 'value' : group, 'child': [u'message', u'iq', u'presence-out']} gajim.connections[account].blocked_list.append(new_rule) + # needed for draw_group: + gajim.connections[account].blocked_groups.append(group) + self.draw_group(group, account) for account in accounts: gajim.connections[account].set_privacy_list( 'block', gajim.connections[account].blocked_list) @@ -1533,11 +1534,10 @@ class RosterWindow: or rule['value'] != group: gajim.connections[account].new_blocked_list.append( rule) - # needed for draw_contact: - if contact.jid in gajim.connections[account].blocked_contacts: - gajim.connections[account].blocked_contacts.remove( - contact.jid) - self.draw_contact(contact.jid, account) + # needed for draw_group: + if group in gajim.connections[account].blocked_groups: + gajim.connections[account].blocked_groups.remove(group) + self.draw_group(group, account) for account in accounts: gajim.connections[account].set_privacy_list( 'block', gajim.connections[account].new_blocked_list)