summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-07-20 12:18:38 -0400
committerLance Stout <lancestout@gmail.com>2010-07-20 12:18:38 -0400
commit7ad014368709873ed8ab760acc62264278f7723f (patch)
treeb4bf04abe5364811b6cf32350696823a9ad5895d /sleekxmpp
parentde24e9ed458cea4bccb9962b69e5fb4271841b3d (diff)
downloadslixmpp-7ad014368709873ed8ab760acc62264278f7723f.tar.gz
slixmpp-7ad014368709873ed8ab760acc62264278f7723f.tar.bz2
slixmpp-7ad014368709873ed8ab760acc62264278f7723f.tar.xz
slixmpp-7ad014368709873ed8ab760acc62264278f7723f.zip
Updated pubsub stanzas to use xep_0004 stanza objects, and updated tests to match.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/stanza_pubsub.py50
1 files changed, 4 insertions, 46 deletions
diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py
index e04f1a7f..96d02f93 100644
--- a/sleekxmpp/plugins/stanza_pubsub.py
+++ b/sleekxmpp/plugins/stanza_pubsub.py
@@ -257,7 +257,7 @@ class Configure(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'configure'
plugin_attrib = name
- interfaces = set(('node', 'type', 'config'))
+ interfaces = set(('node', 'type'))
plugin_attrib_map = {}
plugin_tag_map = {}
@@ -266,22 +266,8 @@ class Configure(ElementBase):
if not t: t == 'leaf'
return t
- def getConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- form = xep_0004.Form()
- if config is not None:
- form.fromXML(config)
- return form
-
- def setConfig(self, value):
- self.xml.append(value.getXML())
- return self
-
- def delConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- self.xml.remove(config)
-
registerStanzaPlugin(Pubsub, Configure)
+registerStanzaPlugin(Configure, xep_0004.Form)
class DefaultConfig(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#owner'
@@ -293,21 +279,6 @@ class DefaultConfig(ElementBase):
def __init__(self, *args, **kwargs):
ElementBase.__init__(self, *args, **kwargs)
-
- def getConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- form = xep_0004.Form()
- if config is not None:
- form.fromXML(config)
- return form
-
- def setConfig(self, value):
- self.xml.append(value.getXML())
- return self
-
- def delConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- self.xml.remove(config)
def getType(self):
t = self._getAttr('type')
@@ -315,6 +286,7 @@ class DefaultConfig(ElementBase):
return t
registerStanzaPlugin(PubsubOwner, DefaultConfig)
+registerStanzaPlugin(DefaultConfig, xep_0004.Form)
class Options(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
@@ -538,22 +510,8 @@ class EventConfiguration(ElementBase):
plugin_attrib_map = {}
plugin_tag_map = {}
- def getConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- form = xep_0004.Form()
- if config is not None:
- form.fromXML(config)
- return form
-
- def setConfig(self, value):
- self.xml.append(value.getXML())
- return self
-
- def delConfig(self):
- config = self.xml.find('{jabber:x:data}x')
- self.xml.remove(config)
-
registerStanzaPlugin(Event, EventConfiguration)
+registerStanzaPlugin(EventConfiguration, xep_0004.Form)
class EventPurge(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'