draw blocked groups striked
This commit is contained in:
parent
1114b4c946
commit
09aa41a4df
|
@ -392,13 +392,15 @@ class RosterWindow:
|
||||||
accounts = []
|
accounts = []
|
||||||
else:
|
else:
|
||||||
accounts = [account]
|
accounts = [account]
|
||||||
text = group
|
text = gobject.markup_escape_text(group)
|
||||||
|
if group in gajim.connections[account].blocked_groups:
|
||||||
|
text = '<span strikethrough="true">%s</span>' % text
|
||||||
if gajim.config.get('show_contacts_number'):
|
if gajim.config.get('show_contacts_number'):
|
||||||
nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts(
|
nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts(
|
||||||
accounts = accounts, groups = [group])
|
accounts = accounts, groups = [group])
|
||||||
text += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total))
|
text += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total))
|
||||||
model = self.tree.get_model()
|
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 = ''):
|
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,
|
''' 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)
|
self.draw_contact(contact.jid, account)
|
||||||
else:
|
else:
|
||||||
group = model[iter][C_JID].decode('utf-8')
|
group = model[iter][C_JID].decode('utf-8')
|
||||||
msg = self.get_status_message('offline')
|
|
||||||
for (contact, account) in group_list:
|
for (contact, account) in group_list:
|
||||||
if account not in accounts:
|
if account not in accounts:
|
||||||
if not gajim.connections[account].privacy_rules_supported:
|
if not gajim.connections[account].privacy_rules_supported:
|
||||||
continue
|
continue
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
self.send_status(account, 'offline', msg, to=contact.jid)
|
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',
|
new_rule = {'order': u'1', 'type': u'group', 'action': u'deny',
|
||||||
'value' : group, 'child': [u'message', u'iq', u'presence-out']}
|
'value' : group, 'child': [u'message', u'iq', u'presence-out']}
|
||||||
gajim.connections[account].blocked_list.append(new_rule)
|
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:
|
for account in accounts:
|
||||||
gajim.connections[account].set_privacy_list(
|
gajim.connections[account].set_privacy_list(
|
||||||
'block', gajim.connections[account].blocked_list)
|
'block', gajim.connections[account].blocked_list)
|
||||||
|
@ -1533,11 +1534,10 @@ class RosterWindow:
|
||||||
or rule['value'] != group:
|
or rule['value'] != group:
|
||||||
gajim.connections[account].new_blocked_list.append(
|
gajim.connections[account].new_blocked_list.append(
|
||||||
rule)
|
rule)
|
||||||
# needed for draw_contact:
|
# needed for draw_group:
|
||||||
if contact.jid in gajim.connections[account].blocked_contacts:
|
if group in gajim.connections[account].blocked_groups:
|
||||||
gajim.connections[account].blocked_contacts.remove(
|
gajim.connections[account].blocked_groups.remove(group)
|
||||||
contact.jid)
|
self.draw_group(group, account)
|
||||||
self.draw_contact(contact.jid, account)
|
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
gajim.connections[account].set_privacy_list(
|
gajim.connections[account].set_privacy_list(
|
||||||
'block', gajim.connections[account].new_blocked_list)
|
'block', gajim.connections[account].new_blocked_list)
|
||||||
|
|
Loading…
Reference in New Issue