Ignore:
Timestamp:
Jul 6, 2009, 9:24:58 AM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@174
Message:

Add sender parameter to disco requests.

Author: ralphm
Fixes #52.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/disco.py

    r49 r62  
    374374    """
    375375
    376     def requestInfo(self, entity, nodeIdentifier=''):
     376    def requestInfo(self, entity, nodeIdentifier='', sender=None):
    377377        """
    378378        Request information discovery from a node.
     
    380380        @param entity: Entity to send the request to.
    381381        @type entity: L{jid.JID}
     382
    382383        @param nodeIdentifier: Optional node to request info from.
    383384        @type nodeIdentifier: C{unicode}
     385
     386        @param sender: Optional sender address.
     387        @type sender: L{jid.JID}
    384388        """
    385389
    386390        request = _DiscoRequest(self.xmlstream, NS_DISCO_INFO, nodeIdentifier)
     391        if sender is not None:
     392            request['from'] = unicode(sender)
    387393
    388394        d = request.send(entity.full())
     
    391397
    392398
    393     def requestItems(self, entity, nodeIdentifier=''):
     399    def requestItems(self, entity, nodeIdentifier='', sender=None):
    394400        """
    395401        Request items discovery from a node.
     
    397403        @param entity: Entity to send the request to.
    398404        @type entity: L{jid.JID}
     405
    399406        @param nodeIdentifier: Optional node to request info from.
    400407        @type nodeIdentifier: C{unicode}
     408
     409        @param sender: Optional sender address.
     410        @type sender: L{jid.JID}
    401411        """
    402412
    403413        request = _DiscoRequest(self.xmlstream, NS_DISCO_ITEMS, nodeIdentifier)
     414        if sender is not None:
     415            request['from'] = unicode(sender)
    404416
    405417        d = request.send(entity.full())
Note: See TracChangeset for help on using the changeset viewer.