summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-10 00:07:15 -0800
committerLance Stout <lancestout@gmail.com>2012-03-10 00:07:15 -0800
commit861d279b0822fe66cb6311898c808ab6f0e4a3b2 (patch)
tree988edcb4884d2d66f5433ce1093f3a1f49a88bf3 /sleekxmpp/plugins
parenteb1a32fc90eff6c13611b6cc53d66411387fa120 (diff)
downloadslixmpp-861d279b0822fe66cb6311898c808ab6f0e4a3b2.tar.gz
slixmpp-861d279b0822fe66cb6311898c808ab6f0e4a3b2.tar.bz2
slixmpp-861d279b0822fe66cb6311898c808ab6f0e4a3b2.tar.xz
slixmpp-861d279b0822fe66cb6311898c808ab6f0e4a3b2.zip
Correct missing pubsub#event stanzas and interfaces.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0060/stanza/pubsub_event.py33
1 files changed, 29 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub_event.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub_event.py
index c7263577..7f77d721 100644
--- a/sleekxmpp/plugins/xep_0060/stanza/pubsub_event.py
+++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub_event.py
@@ -15,14 +15,14 @@ class Event(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'event'
plugin_attrib = 'pubsub_event'
- interfaces = set(('node',))
+ interfaces = set()
class EventItem(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'item'
plugin_attrib = name
- interfaces = set(('id', 'payload'))
+ interfaces = set(('id', 'payload', 'node', 'publisher'))
def set_payload(self, value):
self.xml.append(value)
@@ -76,7 +76,7 @@ class EventConfiguration(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'configuration'
plugin_attrib = name
- interfaces = set(('node', 'config'))
+ interfaces = set(('node',))
class EventPurge(ElementBase):
@@ -86,6 +86,30 @@ class EventPurge(ElementBase):
interfaces = set(('node',))
+class EventDelete(ElementBase):
+ namespace = 'http://jabber.org/protocol/pubsub#event'
+ name = 'delete'
+ plugin_attrib = name
+ interfaces = set(('node', 'redirect'))
+
+ def set_redirect(self, uri):
+ del self['redirect']
+ redirect = ET.Element('{%s}redirect' % self.namespace)
+ redirect.attrib['uri'] = uri
+ self.xml.append(redirect)
+
+ def get_redirect(self):
+ redirect = self.xml.find('{%s}redirect' % self.namespace)
+ if redirect is not None:
+ return redirect.attrib.get('uri', '')
+ return ''
+
+ def del_redirect(self):
+ redirect = self.xml.find('{%s}redirect' % self.namespace)
+ if redirect is not None:
+ self.xml.remove(redirect)
+
+
class EventSubscription(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'subscription'
@@ -102,8 +126,9 @@ class EventSubscription(ElementBase):
register_stanza_plugin(Message, Event)
register_stanza_plugin(Event, EventCollection)
register_stanza_plugin(Event, EventConfiguration)
-register_stanza_plugin(Event, EventItems)
register_stanza_plugin(Event, EventPurge)
+register_stanza_plugin(Event, EventDelete)
+register_stanza_plugin(Event, EventItems)
register_stanza_plugin(Event, EventSubscription)
register_stanza_plugin(EventCollection, EventAssociate)
register_stanza_plugin(EventCollection, EventDisassociate)