From 4e7871f695582adc49a4cadacb89ded7ff150fd0 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 10 Jun 2007 04:17:56 +0000 Subject: [PATCH] Make 'send custom status' in contacts content menu insensitive. --- src/roster_window.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/roster_window.py b/src/roster_window.py index 6cfd7cd8b..3f8b8e9cd 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2007,7 +2007,24 @@ class RosterWindow: add_special_notification_menuitem.set_no_show_all(True) # send custom status icon - if gajim.interface.status_sent_to_users.has_key(account) and \ + blocked = False + if jid in gajim.connections[account].blocked_contacts: + blocked = True + else: + groups = contact.groups + if contact.is_observer(): + groups = [_('Observers')] + elif not groups: + groups = [_('General')] + for group in groups: + if group in gajim.connections[account].blocked_groups: + blocked = True + break + if blocked: + icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU) + send_custom_status_menuitem.set_image(icon) + send_custom_status_menuitem.set_sensitive(False) + elif gajim.interface.status_sent_to_users.has_key(account) and \ jid in gajim.interface.status_sent_to_users[account]: send_custom_status_menuitem.set_image( self.load_icon(gajim.interface.status_sent_to_users[account][jid]))