Ignore:
Timestamp:
Mar 4, 2008, 12:18:23 PM (14 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@43
Message:

Add notifyDelete to send out node deletion notifications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r13 r15  
    250250            return
    251251
     252        actionElement = None
    252253        for element in message.event.elements():
    253254            if element.uri == NS_PUBSUB_EVENT:
     
    735736
    736737    def notifyPublish(self, service, nodeIdentifier, notifications):
    737 
    738         print notifications
    739738        for recipient, items in notifications:
    740739            message = domish.Element((None, "message"))
     
    747746            self.send(message)
    748747
     748    def notifyDelete(self, service, nodeIdentifier, recipients):
     749        for recipient in recipients:
     750            message = domish.Element((None, "message"))
     751            message["from"] = service.full()
     752            message["to"] = recipient.full()
     753            event = message.addElement((NS_PUBSUB_EVENT, "event"))
     754            element = event.addElement("delete")
     755            element["node"] = nodeIdentifier
     756            self.send(message)
     757
    749758    def getNodeInfo(self, requestor, service, nodeIdentifier):
    750759        return None
Note: See TracChangeset for help on using the changeset viewer.