Skip to content
Snippets Groups Projects
Commit 7a89f716 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

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

parent 56dfe11c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment