From 7a89f716e46667f27ee74785ef247f424871930c Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 5 Sep 2006 15:43:07 +0000 Subject: [PATCH] handle correctly notification window in ANC, particulary le tab_opened condition. --- src/common/helpers.py | 8 +++++--- src/notify.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/helpers.py b/src/common/helpers.py index 3ff4b4978..1aedc4c99 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -726,10 +726,12 @@ def sanitize_filename(filename): return filename -def allow_showing_notification(account, type = None, advanced_notif_num = None): +def allow_showing_notification(account, type = None, advanced_notif_num = None, +first = True): '''is it allowed to show nofication? check OUR status and if we allow notifications for that status - type is the option that need to be True ex: notify_on_signin''' + type is the option that need to be True ex: notify_on_signing + first: set it to false when it's not the first message''' if advanced_notif_num != None: popup = gajim.config.get_per('notifications', str(advanced_notif_num), 'popup') @@ -737,7 +739,7 @@ def allow_showing_notification(account, type = None, advanced_notif_num = None): return True if popup == 'no': return False - if type and not gajim.config.get(type): + if type and not gajim.config.get(type) and first: return False if gajim.config.get('autopopupaway'): # always show notification return True diff --git a/src/notify.py b/src/notify.py index e4578e072..a99479864 100644 --- a/src/notify.py +++ b/src/notify.py @@ -148,7 +148,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None): nickname = parameters[2] message = parameters[3] if helpers.allow_showing_notification(account, 'notify_on_new_message', - advanced_notif_num) and first: + advanced_notif_num, first): do_popup = True if first and helpers.allow_sound_notification('first_message_received', advanced_notif_num):