handle correctly notification window in ANC, particulary le tab_opened condition.
This commit is contained in:
parent
56dfe11c56
commit
7a89f716e4
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue