Mercurial > libervia-backend
changeset 2556:340128e0b354
jp (base): fixed URI's item with use_pubsub
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 01 Apr 2018 20:41:03 +0200 |
parents | ebdaaf858f21 |
children | f2a829bbdbb5 |
files | frontends/src/jp/base.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/src/jp/base.py Sun Apr 01 20:17:00 2018 +0200 +++ b/frontends/src/jp/base.py Sun Apr 01 20:41:03 2018 +0200 @@ -504,14 +504,22 @@ self.args.node = uri_data[u'node'] uri_item = uri_data.get(u'item') if uri_item: + # there is an item in URI + # we use it only if item is not already set + # and item_last is not used either try: - item, item_magic = self.args.item, self.args.item_magic + item = self.args.item except AttributeError: if not self.args.items: self.args.items = [uri_item] else: - if not item and not item_magic: - self.args.item = uri_item + if not item: + try: + item_last = self.args.item_last + except AttributeError: + item_last = False + if not item_last: + self.args.item = uri_item else: self.parser.error(_(u'XMPP URL is not a pubsub one: {url}').format(url=url)) flags = self.args._cmd._pubsub_flags