Changeset 15:14a00be2ae9d


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.

Location:
wokkel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wokkel/iwokkel.py

    r13 r15  
    7474        """
    7575
     76
    7677class IXMPPHandlerCollection(Interface):
    7778    """
     
    99100        @type handler: L{IXMPPHandler}
    100101        """
     102
    101103
    102104class IDisco(Interface):
     
    278280        """
    279281
     282    def notifyDelete(service, nodeIdentifier, recipients):
     283        """
     284        Send out node deletion notifications.
     285
     286        @param service: The entity the notifications will originate from.
     287        @type service: L{jid.JID}
     288        @param nodeIdentifier: The identifier of the node that was deleted.
     289        @type nodeIdentifier: C{unicode}
     290        @param recipients: The entities that the notification is sent to.
     291        @type notifications: C{list} of L{jid.JID}
     292        """
     293
    280294    def publish(requestor, service, nodeIdentifier, items):
    281295        """
  • 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.