fixed dropped messages after initiating a tic-tac-toe game with a contact that doesn't support sessions
This commit is contained in:
parent
58478b032d
commit
2552e1024f
|
@ -1777,11 +1777,17 @@ haven't received a thread_id yet and returns the session that we last
|
||||||
sent a message to.'''
|
sent a message to.'''
|
||||||
|
|
||||||
sessions = self.sessions[jid].values()
|
sessions = self.sessions[jid].values()
|
||||||
no_threadid_sessions = filter(lambda s: not s.received_thread_id, sessions)
|
|
||||||
|
|
||||||
if no_threadid_sessions:
|
# sessions that we haven't received a thread ID in
|
||||||
no_threadid_sessions.sort(key=lambda s: s.last_send)
|
idless = filter(lambda s: not s.received_thread_id, sessions)
|
||||||
return no_threadid_sessions[-1]
|
|
||||||
|
# filter out everything exceptthe default session type
|
||||||
|
chat_sessions = filter(lambda s: isinstance(s, ChatControlSession), idless)
|
||||||
|
|
||||||
|
if chat_sessions:
|
||||||
|
# return the session that we last sent a message in
|
||||||
|
chat_sessions.sort(key=lambda s: s.last_send)
|
||||||
|
return chat_sessions[-1]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue