summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/stanza_pubsub.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
committerNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
commit18e27d65ce47d877d6b2c810979df640aba7d8ba (patch)
tree942ed2d45a54e830d6e7c005e3f872c480477866 /sleekxmpp/plugins/stanza_pubsub.py
parent0c39567f208db4938614e9723901037d8801fb25 (diff)
parentaa916c9ac893a976c8e26ee07ca4a9768a5e1680 (diff)
downloadslixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.gz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.bz2
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.xz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'sleekxmpp/plugins/stanza_pubsub.py')
-rw-r--r--sleekxmpp/plugins/stanza_pubsub.py45
1 files changed, 33 insertions, 12 deletions
diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py
index 1dd73d99..1a1526f0 100644
--- a/sleekxmpp/plugins/stanza_pubsub.py
+++ b/sleekxmpp/plugins/stanza_pubsub.py
@@ -10,6 +10,39 @@ def stanzaPlugin(stanza, plugin):
stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
+class PubsubState(ElementBase):
+ namespace = 'http://jabber.org/protocol/psstate'
+ name = 'state'
+ plugin_attrib = 'psstate'
+ interfaces = set(('node', 'item', 'payload'))
+ plugin_attrib_map = {}
+ plugin_tag_map = {}
+
+ def setPayload(self, value):
+ self.xml.append(value)
+
+ def getPayload(self):
+ childs = self.xml.getchildren()
+ if len(childs) > 0:
+ return childs[0]
+
+ def delPayload(self):
+ for child in self.xml.getchildren():
+ self.xml.remove(child)
+
+stanzaPlugin(Iq, PubsubState)
+
+class PubsubStateEvent(ElementBase):
+ namespace = 'http://jabber.org/protocol/psstate#event'
+ name = 'event'
+ plugin_attrib = 'psstate_event'
+ intefaces = set(tuple())
+ plugin_attrib_map = {}
+ plugin_tag_map = {}
+
+stanzaPlugin(Message, PubsubStateEvent)
+stanzaPlugin(PubsubStateEvent, PubsubState)
+
class Pubsub(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'pubsub'
@@ -321,18 +354,6 @@ class Options(ElementBase):
stanzaPlugin(Pubsub, Options)
stanzaPlugin(Subscribe, Options)
-#iq = Iq()
-#iq['pubsub']['defaultconfig']
-#print(iq)
-
-#from xml.etree import cElementTree as ET
-#iq = Iq()
-#item = Item()
-#item['payload'] = ET.Element("{http://netflint.net/p/crap}stupidshit")
-#item['id'] = 'aa11bbcc'
-#iq['pubsub']['items'].append(item)
-#print(iq)
-
class OwnerAffiliations(Affiliations):
namespace = 'http://jabber.org/protocol/pubsub#owner'
interfaces = set(('node'))