From 2a30e3fe0c397bc1111449c2980e77e67d9114c1 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Tue, 20 Apr 2010 00:53:13 -0700 Subject: [PATCH] started work on pubsub#event stanzas --- sleekxmpp/plugins/stanza_pubsub.py | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py index d25c2b3..1334594 100644 --- a/sleekxmpp/plugins/stanza_pubsub.py +++ b/sleekxmpp/plugins/stanza_pubsub.py @@ -1,5 +1,6 @@ from .. xmlstream.stanzabase import ElementBase, ET, JID from .. stanza.iq import Iq +from .. stanza.message import Message from .. basexmpp import basexmpp from .. xmlstream.xmlstream import XMLStream import logging @@ -463,3 +464,33 @@ class OwnerSubscription(ElementBase): def getJid(self): return JID(self._getAttr('from')) + +class Event(ElementBase): + namespace = 'http://jabber.org/protocol/pubsub#event' + name = 'event' + plugin_attrib = 'pubsub_event' + interfaces = set(('node',)) + plugin_attrib_map = {} + plugin_tag_map = {} + +stanzaPlugin(Message, Event) + +class EventItems(ElementBase): + namespace = 'http://jabber.org/protocol/pubsub#event' + name = 'items' + plugin_attrib = 'items' + interfaces = set(tuple()) + plugin_attrib_map = {} + plugin_tag_map = {} + +stanzaPlugin(Event, EventItems) + +class EventItem(ElementBase): + namespace = 'http://jabber.org/protocol/pubsub#event' + name = 'item' + plugin_attrib = 'item' + interfaces = set(tuple()) + plugin_attrib_map = {} + plugin_tag_map = {} + +stanzaPlugin(Event, EventItems)