summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0060/stanza
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/plugins/xep_0060/stanza')
-rw-r--r--sleekxmpp/plugins/xep_0060/stanza/pubsub.py16
-rw-r--r--sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py15
2 files changed, 17 insertions, 14 deletions
diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
index 96655942..68e4f952 100644
--- a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
+++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
@@ -23,9 +23,15 @@ class Affiliation(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'affiliation'
plugin_attrib = name
- interfaces = set(('node', 'affiliation'))
+ interfaces = set(('node', 'affiliation', 'jid'))
plugin_attrib_map = {}
plugin_tag_map = {}
+
+ def setJid(self, value):
+ self._setAttr('jid', str(value))
+
+ def getJid(self):
+ return JID(self._getAttr('jid'))
class Affiliations(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
@@ -36,12 +42,6 @@ class Affiliations(ElementBase):
plugin_tag_map = {}
subitem = (Affiliation,)
- def append(self, affiliation):
- if not isinstance(affiliation, Affiliation):
- raise TypeError
- self.xml.append(affiliation.xml)
- return self.iterables.append(affiliation)
-
registerStanzaPlugin(Pubsub, Affiliations)
@@ -164,7 +164,7 @@ class Unsubscribe(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'unsubscribe'
plugin_attrib = name
- interfaces = set(('node', 'jid'))
+ interfaces = set(('node', 'jid', 'subid'))
plugin_attrib_map = {}
plugin_tag_map = {}
diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py
index a90780cc..a8ced8a9 100644
--- a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py
+++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py
@@ -65,10 +65,19 @@ class OwnerAffiliation(Affiliation):
plugin_tag_map = {}
class OwnerConfigure(Configure):
+ name = 'configure'
+ plugin_attrib = 'configure'
namespace = 'http://jabber.org/protocol/pubsub#owner'
interfaces = set(('node', 'config'))
plugin_attrib_map = {}
plugin_tag_map = {}
+
+ def getConfig(self):
+ return self['form']
+
+ def setConfig(self, value):
+ self['form'].setStanzaValues(value.getStanzaValues())
+ return self
registerStanzaPlugin(PubsubOwner, OwnerConfigure)
@@ -78,12 +87,6 @@ class OwnerDefault(OwnerConfigure):
plugin_attrib_map = {}
plugin_tag_map = {}
- def getConfig(self):
- return self['form']
-
- def setConfig(self, value):
- self['form'].setStanzaValues(value.getStanzaValues())
- return self
registerStanzaPlugin(PubsubOwner, OwnerDefault)
registerStanzaPlugin(OwnerDefault, xep_0004.Form)