Don't count first messages in roster title when we auto open

This commit is contained in:
Jean-Marie Traissard 2006-11-08 21:28:28 +00:00
parent 5b9a784b68
commit 587a4d4e73
2 changed files with 9 additions and 6 deletions

View File

@ -118,8 +118,8 @@ class Events:
if gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
def get_nb_events(self, types = []):
return self._get_nb_events(types = types)
def get_nb_events(self, types = [], account = None):
return self._get_nb_events(types = types, account = account)
def get_events(self, account, jid = None, types = []):
'''if event is not specified, get all events from this jid,

View File

@ -3962,10 +3962,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
nb_unread = 0
if change_title_allowed:
start = ''
nb_unread = gajim.events.get_nb_events(['chat', 'normal',
'file-request', 'file-error', 'file-completed',
'file-request-error', 'file-send-error', 'file-stopped',
'printed_chat'])
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-error', 'file-send-error', 'file-stopped',
'printed_chat'], account)
if nb_unread > 1:
start = '[' + str(nb_unread) + '] '
elif nb_unread == 1: