From afbd506cfc5aea6e70edc5cb6584e9d36f539965 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 1 Sep 2011 11:30:55 -0700 Subject: Users can retrieve their affiliations now, with tests. --- sleekxmpp/plugins/xep_0060/pubsub.py | 6 ++++++ sleekxmpp/plugins/xep_0060/stanza/pubsub.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0060') diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py index 990e8241..a5db137e 100644 --- a/sleekxmpp/plugins/xep_0060/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/pubsub.py @@ -177,6 +177,12 @@ class xep_0060(base_plugin): iq['pubsub']['subscriptions']['node'] = node return iq.send(block=block, callback=callback, timeout=timeout) + def get_affiliations(self, jid, node=None, ifrom=None, block=True, + callback=None, timeout=None): + iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') + iq['pubsub']['affiliations']['node'] = node + return iq.send(block=block, callback=callback, timeout=timeout) + def get_subscription_options(self, jid, node, user_jid, ifrom=None, block=True, callback=None, timeout=None): iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py index 0cbb7388..6aaafbc1 100644 --- a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py @@ -37,7 +37,7 @@ class Affiliations(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' name = 'affiliations' plugin_attrib = 'affiliations' - interfaces = set(tuple()) + interfaces = set(('node',)) plugin_attrib_map = {} plugin_tag_map = {} subitem = (Affiliation,) -- cgit v1.2.3