Changeset 9064

Show
Ignore:
Timestamp:
11/28/07 20:26:40 (12 months ago)
Author:
bct
Message:

fixed use of common.xmpp namespace in a place it wasn't imported

Location:
trunk/src
Files:
2 modified

Legend:

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

    r8873 r9064  
    585585 
    586586                feature.addChild(node=x) 
    587                  
     587 
    588588                if not_acceptable: 
    589589                        response = xmpp.Error(response, xmpp.ERR_NOT_ACCEPTABLE) 
     
    854854        def acknowledge_termination(self): 
    855855                StanzaSession.acknowledge_termination(self) 
    856                  
     856 
    857857                self.enable_encryption = False 
    858858 
    859         def fail_bad_negotiation(self, reason): 
    860                 '''they've tried to feed us a bogus value, send an error and cancel everything.''' 
     859        def fail_bad_negotiation(self, reason, fields = None): 
     860                '''sends an error and cancels everything. 
     861 
     862if fields == None, the remote party has given us a bad cryptographic value of some kind 
     863 
     864otherwise, list the fields we haven't implemented''' 
    861865 
    862866                err = xmpp.Error(xmpp.Message(), xmpp.ERR_FEATURE_NOT_IMPLEMENTED) 
    863867                err.T.error.T.text.setData(reason) 
     868 
     869                if fields: 
     870                        feature = xmpp.Node(xmpp.NS_FEATURE + ' feature') 
     871 
     872                        for field in fields: 
     873                                fn = xmpp.Node('field') 
     874                                fn['var'] = field 
     875                                feature.addChild(node=feature) 
     876 
     877                        err.addChild(node=feature) 
     878 
    864879                self.send(err) 
    865880 
  • trunk/src/gajim.py

    r9053 r9064  
    18991899                                        # we don't support 3-message negotiation as the responder 
    19001900                                        if 'dhkeys' in form.asDict(): 
    1901                                                 err = xmpp.Error(xmpp.Message(), xmpp.ERR_FEATURE_NOT_IMPLEMENTED) 
    1902  
    1903                                                 feature = xmpp.Node(xmpp.NS_FEATURE + ' feature') 
    1904                                                 field = xmpp.Node('field') 
    1905                                                 field['var'] = 'dhkeys' 
    1906  
    1907                                                 feature.addChild(node=field) 
    1908                                                 err.addChild(node=feature) 
    1909  
    1910                                                 session.send(err) 
     1901                                                session.fail_bad_negotiation('3 message negotiation not supported when responding', ('dhkeys',)) 
    19111902                                                return 
    19121903