Show
Ignore:
Timestamp:
08/31/07 19:22:58 (15 months ago)
Author:
asterix
Message:

[misc] repare sending composing chatstates using xep instead of xep. Fix #3241.

Location:
branches/gajim_0.11.1/src/common
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/connection.py

    r8676 r8683  
    700700 
    701701        def send_message(self, jid, msg, keyID, type = 'chat', subject='', 
    702         chatstate = None, msg_id = None, composing_jep = None, resource = None, 
     702        chatstate = None, msg_id = None, composing_xep = None, resource = None, 
    703703        user_nick = None, xhtml = None): 
    704704                if not self.connection: 
     
    754754                # tag is the active event 
    755755                if chatstate is not None: 
    756                         if (composing_jep == 'JEP-0085' or not composing_jep) and \ 
    757                         composing_jep != 'asked_once': 
    758                                 # JEP-0085 
     756                        if (composing_xep == 'XEP-0085' or not composing_xep) and \ 
     757                        composing_xep != 'asked_once': 
     758                                # XEP-0085 
    759759                                msg_iq.setTag(chatstate, namespace = common.xmpp.NS_CHATSTATES) 
    760                         if composing_jep in ('JEP-0022', 'asked_once') or not composing_jep: 
    761                                 # JEP-0022 
     760                        if composing_xep in ('XEP-0022', 'asked_once') or not composing_xep: 
     761                                # XEP-0022 
    762762                                chatstate_node = msg_iq.setTag('x', 
    763763                                        namespace = common.xmpp.NS_EVENT) 
  • branches/gajim_0.11.1/src/common/contacts.py

    r8661 r8683  
    2121        def __init__(self, jid='', name='', groups=[], show='', status='', sub='', 
    2222        ask='', resource='', priority=0, keyID='', our_chatstate=None, 
    23         chatstate=None, last_status_time=None, msg_id = None, composing_jep = None): 
     23        chatstate=None, last_status_time=None, msg_id = None, composing_xep = None): 
    2424                self.jid = jid 
    2525                self.name = name 
     
    4444                self.msg_id = msg_id 
    4545                # tell which JEP we're using for composing state 
    46                 # None = have to ask, JEP-0022 = use this jep, 
    47                 # JEP-0085 = use this jep, False = no composing support 
    48                 self.composing_jep = composing_jep 
     46                # None = have to ask, XEP-0022 = use this jep, 
     47                # XEP-0085 = use this jep, False = no composing support 
     48                self.composing_xep = composing_xep 
    4949                # this is contact's chatstate 
    5050                self.chatstate = chatstate 
     
    145145        def create_contact(self, jid='', name='', groups=[], show='', status='', 
    146146                sub='', ask='', resource='', priority=0, keyID='', our_chatstate=None, 
    147                 chatstate=None, last_status_time=None, composing_jep=None): 
     147                chatstate=None, last_status_time=None, composing_xep=None): 
    148148                return Contact(jid, name, groups, show, status, sub, ask, resource, 
    149149                        priority, keyID, our_chatstate, chatstate, last_status_time, 
    150                         composing_jep) 
     150                        composing_xep) 
    151151         
    152152        def copy_contact(self, contact): 
  • branches/gajim_0.11.1/src/common/zeroconf/connection_handlers_zeroconf.py

    r7568 r8683  
    652652                delayed = msg.getTag('x', namespace = common.xmpp.NS_DELAY) != None 
    653653                msg_id = None 
    654                 composing_jep = None 
     654                composing_xep = None 
    655655                xtags = msg.getTags('x') 
    656656                # chatstates - look for chatstate tags in a message if not delayed 
    657657                if not delayed: 
    658                         composing_jep = False 
     658                        composing_xep = False 
    659659                        children = msg.getChildren() 
    660660                        for child in children: 
    661661                                if child.getNamespace() == 'http://jabber.org/protocol/chatstates': 
    662662                                        chatstate = child.getName() 
    663                                         composing_jep = 'JEP-0085' 
     663                                        composing_xep = 'XEP-0085' 
    664664                                        break 
    665665                        # No JEP-0085 support, fallback to JEP-0022 
     
    668668                                if chatstate_child: 
    669669                                        chatstate = 'active' 
    670                                         composing_jep = 'JEP-0022' 
     670                                        composing_xep = 'XEP-0022' 
    671671                                        if not msgtxt and chatstate_child.getTag('composing'): 
    672672                                                chatstate = 'composing' 
     
    704704                                        subject = subject) 
    705705                        self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject, 
    706                                 chatstate, msg_id, composing_jep, user_nick, msghtml)) 
     706                                chatstate, msg_id, composing_xep, user_nick, msghtml)) 
    707707                elif mtype == 'normal': # it's single message 
    708708                        if self.name not in no_log_for and jid not in no_log_for and msgtxt: 
     
    711711                        if invite: 
    712712                                self.dispatch('MSG', (frm, msgtxt, tim, encrypted, 'normal', 
    713                                         subject, chatstate, msg_id, composing_jep, user_nick)) 
     713                                        subject, chatstate, msg_id, composing_xep, user_nick)) 
    714714        # END messageCB 
    715715         
  • branches/gajim_0.11.1/src/common/zeroconf/connection_zeroconf.py

    r8653 r8683  
    346346 
    347347        def send_message(self, jid, msg, keyID, type = 'chat', subject='', 
    348         chatstate = None, msg_id = None, composing_jep = None, resource = None,  
     348        chatstate = None, msg_id = None, composing_xep = None, resource = None,  
    349349        user_nick = None): 
    350350                fjid = jid 
     
    394394                # tag is the active event 
    395395                if chatstate is not None: 
    396                         if composing_jep == 'JEP-0085' or not composing_jep: 
     396                        if composing_xep == 'XEP-0085' or not composing_xep: 
    397397                                # JEP-0085 
    398398                                msg_iq.setTag(chatstate, namespace = common.xmpp.NS_CHATSTATES) 
    399                         if composing_jep == 'JEP-0022' or not composing_jep: 
     399                        if composing_xep == 'XEP-0022' or not composing_xep: 
    400400                                # JEP-0022 
    401401                                chatstate_node = msg_iq.setTag('x', namespace = common.xmpp.NS_EVENT)