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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/chat_control.py

    r8601 r8683  
    511511 
    512512        def send_message(self, message, keyID = '', type = 'chat', chatstate = None, 
    513         msg_id = None, composing_jep = None, resource = None): 
     513        msg_id = None, composing_xep = None, resource = None): 
    514514                '''Send the given message to the active tab. Doesn't return None if error 
    515515                ''' 
     
    521521                        ret = MessageControl.send_message(self, message, keyID, type = type, 
    522522                                chatstate = chatstate, msg_id = msg_id, 
    523                                 composing_jep = composing_jep, resource = resource, 
     523                                composing_xep = composing_xep, resource = resource, 
    524524                                user_nick = self.user_nick) 
    525525                        if ret: 
     
    10841084                        if contact.show == 'offline': 
    10851085                                chatstate = '' 
    1086                         elif contact.composing_jep == 'JEP-0085': 
     1086                        elif contact.composing_xep == 'XEP-0085': 
    10871087                                if st == 'all' or cs == 'composing': 
    10881088                                        chatstate = helpers.get_uf_chatstate(cs) 
    10891089                                else: 
    10901090                                        chatstate = '' 
    1091                         elif contact.composing_jep == 'JEP-0022': 
     1091                        elif contact.composing_xep == 'XEP-0022': 
    10921092                                if cs in ('composing', 'paused'): 
    10931093                                        # only print composing, paused 
     
    11611161                chatstates_on = gajim.config.get('outgoing_chat_state_notifications') != \ 
    11621162                        'disabled' 
    1163                 composing_jep = contact.composing_jep 
     1163                composing_xep = contact.composing_xep 
    11641164                chatstate_to_send = None 
    11651165                if chatstates_on and contact is not None: 
    1166                         if composing_jep is None: 
     1166                        if composing_xep is None: 
    11671167                                # no info about peer 
    11681168                                # send active to discover chat state capabilities 
     
    11701170                                # because we want it sent with REAL message 
    11711171                                # (not standlone) eg. one that has body 
    1172                                  
    1173                                 #FIXME: 
    1174                                 # Enable 3 next lines after 0.11 release. 
    1175                                 # Having this disabled violate xep85 5.1.2 but then we don't break 
    1176                                 # notifications between 0.10.1 and 0.11 See #2637 
    1177                                 # if contact.our_chatstate: 
    1178                                 #       # We already ask for xep 85, don't ask it twice 
    1179                                 #       composing_jep = 'asked_once' 
     1172 
     1173                                if contact.our_chatstate: 
     1174                                        # We already asked for xep 85, don't ask it twice 
     1175                                        composing_xep = 'asked_once' 
    11801176 
    11811177                                chatstate_to_send = 'active' 
     
    11831179                        # if peer supports jep85 and we are not 'ask', send 'active' 
    11841180                        # NOTE: first active and 'ask' is set in gajim.py 
    1185                         elif composing_jep is not False: 
     1181                        elif composing_xep is not False: 
    11861182                                #send active chatstate on every message (as JEP says) 
    11871183                                chatstate_to_send = 'active' 
     
    11931189                                 
    11941190                if not ChatControlBase.send_message(self, message, keyID, type = 'chat', 
    1195                 chatstate = chatstate_to_send, composing_jep = composing_jep): 
     1191                chatstate = chatstate_to_send, composing_xep = composing_xep): 
    11961192                        self.print_conversation(message, self.contact.jid, 
    11971193                                encrypted = encrypted) 
     
    14861482                        return 
    14871483 
    1488                 if contact.composing_jep is False: # jid cannot do jep85 nor jep22 
     1484                if contact.composing_xep is False: # jid cannot do xep85 nor xep22 
    14891485                        return 
    14901486 
     
    14941490                        return 
    14951491 
    1496                 if contact.composing_jep is None: 
     1492                if contact.composing_xep is None: 
    14971493                        # we don't know anything about jid, so return 
    14981494                        # NOTE: 
     
    15081504                # in JEP22, when we already sent stop composing 
    15091505                # notification on paused, don't resend it 
    1510                 if contact.composing_jep == 'JEP-0022' and \ 
     1506                if contact.composing_xep == 'XEP-0022' and \ 
    15111507                contact.our_chatstate in ('paused', 'active', 'inactive') and \ 
    15121508                state is not 'composing': # not composing == in (active, inactive, gone) 
     
    15301526 
    15311527                MessageControl.send_message(self, None, chatstate = state, 
    1532                         msg_id = contact.msg_id, composing_jep = contact.composing_jep) 
     1528                        msg_id = contact.msg_id, composing_xep = contact.composing_xep) 
    15331529                contact.our_chatstate = state 
    15341530                if contact.our_chatstate == 'active':