From 58a43e40c71a1095d91b4fa9d852ec07f0bec19f Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 30 Aug 2011 22:27:21 -0700 Subject: Get/set pubsub subscription options. --- sleekxmpp/plugins/xep_0060/pubsub.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sleekxmpp/plugins') diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py index f9999f73..9ce643d9 100644 --- a/sleekxmpp/plugins/xep_0060/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/pubsub.py @@ -169,11 +169,21 @@ class xep_0060(base_plugin): iq['pubsub']['unsubscribe']['subid'] = subid return iq.send(block=block, callback=callback, timeout=timeout) - def get_subscription_options(self): - pass + 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') + iq['pubsub']['options']['node'] = node + iq['pubsub']['options']['jid'] = user_jid + return iq.send(block=block, callback=callback, timeout=timeout) - def set_subscription_options(self): - pass + def set_subscription_options(self, jid, node, user_jid, options, + ifrom=None, block=True, callback=None, + timeout=None): + iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') + iq['pubsub']['options']['node'] = node + iq['pubsub']['options']['jid'] = user_jid + iq['pubsub']['options'].append(options) + return iq.send(block=block, callback=callback, timeout=timeout) def get_node_config(self, jid, node=None, ifrom=None, block=None, callback=None, timeout=None): -- cgit v1.2.3