diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-04-13 19:48:35 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-04-13 19:48:35 -0700 |
commit | 2f9f649d98682817c900736c6775ba8e5b23060f (patch) | |
tree | af56b78eccb82993d9f818f29c18dca23c52985a /sleekxmpp/plugins/stanza_pubsub.py | |
parent | fef511fd518d98a6934bd8048292d07380675d16 (diff) | |
download | slixmpp-2f9f649d98682817c900736c6775ba8e5b23060f.tar.gz slixmpp-2f9f649d98682817c900736c6775ba8e5b23060f.tar.bz2 slixmpp-2f9f649d98682817c900736c6775ba8e5b23060f.tar.xz slixmpp-2f9f649d98682817c900736c6775ba8e5b23060f.zip |
bugfix for .disconnect() hanging
Diffstat (limited to 'sleekxmpp/plugins/stanza_pubsub.py')
-rw-r--r-- | sleekxmpp/plugins/stanza_pubsub.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py index 58f9c896..09cff88a 100644 --- a/sleekxmpp/plugins/stanza_pubsub.py +++ b/sleekxmpp/plugins/stanza_pubsub.py @@ -318,6 +318,39 @@ class DefaultConfig(ElementBase): stanzaPlugin(Pubsub, DefaultConfig) +class DefaultConfigOwner(ElementBase): + namespace = 'http://jabber.org/protocol/pubsub#owner' + name = 'default' + plugin_attrib = 'default' + interfaces = set(('node', 'type', 'config')) + plugin_attrib_map = {} + plugin_tag_map = {} + + 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') + if not t: t == 'leaf' + return t + +stanzaPlugin(PubsubOwner, DefaultConfig) + class Options(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' name = 'options' |