handle correctly notification window in ANC, particulary le tab_opened condition.

This commit is contained in:
Yann Leboulanger 2006-09-05 15:43:07 +00:00
parent 56dfe11c56
commit 7a89f716e4
2 changed files with 6 additions and 4 deletions

View File

@ -726,10 +726,12 @@ def sanitize_filename(filename):
return 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? '''is it allowed to show nofication?
check OUR status and if we allow notifications for that status 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: if advanced_notif_num != None:
popup = gajim.config.get_per('notifications', str(advanced_notif_num), popup = gajim.config.get_per('notifications', str(advanced_notif_num),
'popup') 'popup')
@ -737,7 +739,7 @@ def allow_showing_notification(account, type = None, advanced_notif_num = None):
return True return True
if popup == 'no': if popup == 'no':
return False return False
if type and not gajim.config.get(type): if type and not gajim.config.get(type) and first:
return False return False
if gajim.config.get('autopopupaway'): # always show notification if gajim.config.get('autopopupaway'): # always show notification
return True return True

View File

@ -148,7 +148,7 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
nickname = parameters[2] nickname = parameters[2]
message = parameters[3] message = parameters[3]
if helpers.allow_showing_notification(account, 'notify_on_new_message', if helpers.allow_showing_notification(account, 'notify_on_new_message',
advanced_notif_num) and first: advanced_notif_num, first):
do_popup = True do_popup = True
if first and helpers.allow_sound_notification('first_message_received', if first and helpers.allow_sound_notification('first_message_received',
advanced_notif_num): advanced_notif_num):