don't always show events in systray when notify_on_all_muc_mesages is False

This commit is contained in:
Yann Leboulanger 2008-02-27 21:33:50 +00:00
parent b5c19e0884
commit b3f3a812a9
2 changed files with 6 additions and 2 deletions

View File

@ -685,7 +685,7 @@ class ChatControlBase(MessageControl):
show_in_roster = notify.get_show_in_roster(event,
self.account, self.contact)
show_in_systray = notify.get_show_in_systray(event,
self.account, self.contact)
self.account, self.contact, type_)
event = gajim.events.create_event(type_, None,
show_in_roster = show_in_roster,
show_in_systray = show_in_systray)

View File

@ -70,7 +70,7 @@ def get_show_in_roster(event, account, contact):
return False
return True
def get_show_in_systray(event, account, contact):
def get_show_in_systray(event, account, contact, type_=None):
'''Return True if this event must be shown in systray, else False'''
num = get_advanced_notification(event, account, contact)
if num != None:
@ -78,6 +78,10 @@ def get_show_in_systray(event, account, contact):
return True
if gajim.config.get_per('notifications', str(num), 'systray') == 'no':
return False
if type_ == 'printed_gc_msg' and not gajim.config.get(
'notify_on_all_muc_messages'):
# it's not an highlighted message, don't show in systray
return False
return gajim.config.get('trayicon_notification_on_events')
def get_advanced_notification(event, account, contact):