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

fix type of returns variable in get_events: it's a dict if jid is not given

parent 164a21a0
No related branches found
No related tags found
No related merge requests found
......@@ -160,12 +160,14 @@ class Events:
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,
'''returns all events from the given account of the form
{jid1: [], jid2: []}
if jid is given, returns all events from the given jid in a list: []
optionnaly only from given type'''
if not self._events.has_key(account):
return []
events_list = [] # list of events
if not jid:
events_list = {} # list of events
for jid_ in self._events[account]:
events = []
for ev in self._events[account][jid_]:
......@@ -176,6 +178,7 @@ class Events:
return events_list
if not self._events[account].has_key(jid):
return []
events_list = [] # list of events
for ev in self._events[account][jid]:
if not types or ev.type_ in types:
events_list.append(ev)
......
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