comparison frontends/src/jp/cmd_pubsub.py @ 2442:b8ffb7f8056b

plugin XEP-0060: added "options" argument to psSubscribe, and return subscription id if present
author Goffi <goffi@goffi.org>
date Sun, 19 Nov 2017 16:41:59 +0100
parents 6908fe4c6eca
children 83f9b9ff1a54
comparison
equal deleted inserted replaced
2441:e86dc8cb4345 2442:b8ffb7f8056b
656 self.need_loop=True 656 self.need_loop=True
657 657
658 def add_parser_options(self): 658 def add_parser_options(self):
659 pass 659 pass
660 660
661 def psSubscribeCb(self): 661 def psSubscribeCb(self, sub_id):
662 self.disp(_(u'subscription done'), 1) 662 self.disp(_(u'subscription done'), 1)
663 if sub_id:
664 self.disp(_(u'subscription id: {sub_id}').format(sub_id=sub_id))
663 self.host.quit() 665 self.host.quit()
664 666
665 def start(self): 667 def start(self):
666 self.host.bridge.psSubscribe( 668 self.host.bridge.psSubscribe(
667 self.args.service, 669 self.args.service,
668 self.args.node, 670 self.args.node,
671 {},
669 self.profile, 672 self.profile,
670 callback=self.psSubscribeCb, 673 callback=self.psSubscribeCb,
671 errback=partial(self.errback, 674 errback=partial(self.errback,
672 msg=_(u"can't subscribe to node: {}"), 675 msg=_(u"can't subscribe to node: {}"),
673 exit_code=C.EXIT_BRIDGE_ERRBACK)) 676 exit_code=C.EXIT_BRIDGE_ERRBACK))