Changeset 9639

Show
Ignore:
Timestamp:
05/14/08 04:57:29 (2 months ago)
Author:
bct
Message:

fixed dropped messages after initiating a tic-tac-toe game with a contact that doesn't support sessions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/common/connection_handlers.py

    r9625 r9639  
    17781778 
    17791779                sessions = self.sessions[jid].values() 
    1780                 no_threadid_sessions = filter(lambda s: not s.received_thread_id, sessions) 
    1781  
    1782                 if no_threadid_sessions: 
    1783                         no_threadid_sessions.sort(key=lambda s: s.last_send) 
    1784                         return no_threadid_sessions[-1] 
     1780 
     1781                # sessions that we haven't received a thread ID in 
     1782                idless = filter(lambda s: not s.received_thread_id, sessions) 
     1783 
     1784                # filter out everything exceptthe default session type 
     1785                chat_sessions = filter(lambda s: isinstance(s, ChatControlSession), idless) 
     1786 
     1787                if chat_sessions: 
     1788                        # return the session that we last sent a message in 
     1789                        chat_sessions.sort(key=lambda s: s.last_send) 
     1790                        return chat_sessions[-1] 
    17851791                else: 
    17861792                        return None