From ec01e45ed1f811a88c39f17f92a30f2f225a6ebc Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 1 Sep 2011 11:19:25 -0700 Subject: Add ability for a user to get retrieve subscriptions, 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') diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py index 788d3397..990e8241 100644 --- a/sleekxmpp/plugins/xep_0060/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/pubsub.py @@ -171,6 +171,12 @@ class xep_0060(base_plugin): iq['pubsub']['unsubscribe']['subid'] = subid return iq.send(block=block, callback=callback, timeout=timeout) + def get_subscriptions(self, jid, node=None, ifrom=None, block=True, + callback=None, timeout=None): + iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') + iq['pubsub']['subscriptions']['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 d62fc661..0cbb7388 100644 --- a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py @@ -65,7 +65,7 @@ class Subscriptions(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' name = 'subscriptions' plugin_attrib = 'subscriptions' - interfaces = set(tuple()) + interfaces = set(('node',)) plugin_attrib_map = {} plugin_tag_map = {} subitem = (Subscription,) -- cgit v1.2.3