Don't count first messages in roster title when we auto open
This commit is contained in:
parent
5b9a784b68
commit
587a4d4e73
|
@ -118,8 +118,8 @@ class Events:
|
||||||
if gajim.interface.systray_capabilities:
|
if gajim.interface.systray_capabilities:
|
||||||
gajim.interface.systray.set_img()
|
gajim.interface.systray.set_img()
|
||||||
|
|
||||||
def get_nb_events(self, types = []):
|
def get_nb_events(self, types = [], account = None):
|
||||||
return self._get_nb_events(types = types)
|
return self._get_nb_events(types = types, account = account)
|
||||||
|
|
||||||
def get_events(self, account, jid = None, types = []):
|
def get_events(self, account, jid = None, types = []):
|
||||||
'''if event is not specified, get all events from this jid,
|
'''if event is not specified, get all events from this jid,
|
||||||
|
|
|
@ -3962,10 +3962,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
nb_unread = 0
|
nb_unread = 0
|
||||||
if change_title_allowed:
|
if change_title_allowed:
|
||||||
start = ''
|
start = ''
|
||||||
nb_unread = gajim.events.get_nb_events(['chat', 'normal',
|
for account in gajim.connections:
|
||||||
|
# Count events in roster title only if we don't auto open them
|
||||||
|
if not helpers.allow_popup_window(account):
|
||||||
|
nb_unread += gajim.events.get_nb_events(['chat', 'normal',
|
||||||
'file-request', 'file-error', 'file-completed',
|
'file-request', 'file-error', 'file-completed',
|
||||||
'file-request-error', 'file-send-error', 'file-stopped',
|
'file-request-error', 'file-send-error', 'file-stopped',
|
||||||
'printed_chat'])
|
'printed_chat'], account)
|
||||||
if nb_unread > 1:
|
if nb_unread > 1:
|
||||||
start = '[' + str(nb_unread) + '] '
|
start = '[' + str(nb_unread) + '] '
|
||||||
elif nb_unread == 1:
|
elif nb_unread == 1:
|
||||||
|
|
Loading…
Reference in New Issue