Ignore:
Timestamp:
Apr 22, 2009, 5:02:49 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@170
Message:

Allow publish-subscribe client requests to come from a specific JID.

Author: ralphm.
Fixes #46.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r57 r58  
    625625
    626626
    627     def createNode(self, service, nodeIdentifier=None):
     627    def createNode(self, service, nodeIdentifier=None, sender=None):
    628628        """
    629629        Create a publish subscribe node.
     
    637637        request.recipient = service
    638638        request.nodeIdentifier = nodeIdentifier
     639        request.sender = sender
    639640
    640641        def cb(iq):
     
    651652
    652653
    653     def deleteNode(self, service, nodeIdentifier):
     654    def deleteNode(self, service, nodeIdentifier, sender=None):
    654655        """
    655656        Delete a publish subscribe node.
     
    663664        request.recipient = service
    664665        request.nodeIdentifier = nodeIdentifier
     666        request.sender = sender
    665667        return request.send(self.xmlstream)
    666668
    667669
    668     def subscribe(self, service, nodeIdentifier, subscriber):
     670    def subscribe(self, service, nodeIdentifier, subscriber, sender=None):
    669671        """
    670672        Subscribe to a publish subscribe node.
     
    682684        request.nodeIdentifier = nodeIdentifier
    683685        request.subscriber = subscriber
     686        request.sender = sender
    684687
    685688        def cb(iq):
     
    701704
    702705
    703     def unsubscribe(self, service, nodeIdentifier, subscriber):
     706    def unsubscribe(self, service, nodeIdentifier, subscriber, sender=None):
    704707        """
    705708        Unsubscribe from a publish subscribe node.
     
    716719        request.nodeIdentifier = nodeIdentifier
    717720        request.subscriber = subscriber
     721        request.sender = sender
    718722        return request.send(self.xmlstream)
    719723
    720724
    721     def publish(self, service, nodeIdentifier, items=None):
     725    def publish(self, service, nodeIdentifier, items=None, sender=None):
    722726        """
    723727        Publish to a publish subscribe node.
     
    734738        request.nodeIdentifier = nodeIdentifier
    735739        request.items = items
     740        request.sender = sender
    736741        return request.send(self.xmlstream)
    737742
    738743
    739     def items(self, service, nodeIdentifier, maxItems=None):
     744    def items(self, service, nodeIdentifier, maxItems=None, sender=None):
    740745        """
    741746        Retrieve previously published items from a publish subscribe node.
     
    753758        if maxItems:
    754759            request.maxItems = str(int(maxItems))
     760        request.sender = sender
    755761
    756762        def cb(iq):
Note: See TracChangeset for help on using the changeset viewer.