Changeset 2399 for trunk/src/gajim.py

Show
Ignore:
Timestamp:
07/19/05 16:38:58 (3 years ago)
Author:
nk
Message:

[peralta] Chat State Notifications inital patch. I assume that every wm will focus-out before iconify. If that is not the case I am going to use window-state-changed too [to be tested]

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gajim.py

    r2391 r2399  
    345345 
    346346        def handle_event_msg(self, account, array): 
    347                 #('MSG', account, (contact, msg, time, encrypted, msg_type, subject)) 
     347                #('MSG', account, (contact, msg, time, encrypted, msg_type, subject, chatstate_tag)) 
    348348                jid = array[0].split('/')[0] 
    349349                msg_type = array[4] 
     350                chatstate_tag = array[6] 
    350351                if jid.find('@') <= 0: 
    351352                        jid = jid.replace('@', '') 
     
    407408                if self.remote: 
    408409                        self.remote.raise_signal('NewMessage', (account, array)) 
     410                if self.windows[account]['chats'].has_key(jid): 
     411                        chat_win = self.windows[account]['chats'][jid] 
     412                        # chatstates - display jep85 events in window 
     413                        if chatstate_tag != None: 
     414                                if chat_win.chatstates[jid] == 'ask': 
     415                                        chat_win.chatstates[jid] = 'active' 
     416                                chat_win.print_conversation(jid + ' is now ' + chatstate_tag, jid, 'status', tim = array[2]) 
     417                        else: 
     418                                # got no valid jep85 answer, peer does not support it 
     419                                chat_win.chatstates[jid] = -1 
     420                                 
    409421                 
    410422        def handle_event_msgerror(self, account, array):