Changeset 9763

Show
Ignore:
Timestamp:
06/07/08 21:47:19 (6 months ago)
Author:
js
Message:

Initial XEP-0184 support.

TODO:

  • Implement section 5.
  • Think of a way to show in GUI

Possible way: Grey out the sent msg until we receive a <received/>,
but only if we know the other end supports XEP-0184.

  • Maybe implement section 6?
Location:
trunk/src/common
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/config.py

    r9738 r9763  
    312312                        'zeroconf_email': [ opt_str, '', '', True ], 
    313313                        'use_env_http_proxy' : [opt_bool, False], 
     314                        'answer_receipt' : [opt_bool, True], 
     315                        'request_receipt' : [opt_bool, True], 
    314316                        'otr_flags': [opt_int, 58 ], 
    315317                        'publish_mood': [opt_bool, True], 
  • trunk/src/common/connection_handlers.py

    r9760 r9763  
    16941694                encrypted = False 
    16951695                xep_200_encrypted = msg.getTag('c', namespace=common.xmpp.NS_STANZA_CRYPTO) 
     1696                 
     1697                # Receipt requested 
     1698                if msg.getTag('request', namespace='urn:xmpp:receipts') and \ 
     1699                gajim.config.get_per('accounts', self.name, 'answer_receipt'): 
     1700                        receipt = common.xmpp.Message(to = jid, typ = 'chat') 
     1701                        receipt.setID(msg.getID()) 
     1702                        receipt.setTag('received', 
     1703                                namespace='urn:xmpp:receipts') 
     1704                        receipt.setThread(thread_id) 
     1705                        con.send(receipt) 
    16961706 
    16971707                # We don't trust libotr, that's why we only pass the message 
  • trunk/src/common/connection.py

    r9760 r9763  
    11241124                        addresses.addChild('address', attrs = {'type': 'ofrom', 
    11251125                                'jid': forward_from}) 
     1126 
     1127                # TODO: We should also check if the other end supports it 
     1128                #       as XEP 0184 says checking is a SHOULD. Maybe we should 
     1129                #       implement section 6 of the XEP as well? 
     1130                if msgtxt and gajim.config.get_per('accounts', self.name, 
     1131                'request_receipt'): 
     1132                        msg_iq.setTag('request', namespace='urn:xmpp:receipts') 
     1133 
    11261134                if session: 
    11271135                        # XEP-0201 
     
    11321140                        if session.enable_encryption: 
    11331141                                msg_iq = session.encrypt_stanza(msg_iq) 
    1134  
    11351142 
    11361143                self.connection.send(msg_iq)