# HG changeset patch # User Goffi # Date 1551438676 -3600 # Node ID fd45089b3a929941920506d7c7a45b0dabf08025 # Parent 9a7cb32836c69699655b37ae2f0d547c8071ee70 jp (message/mam): added missing RSM options diff -r 9a7cb32836c6 -r fd45089b3a92 sat_frontends/jp/cmd_message.py --- a/sat_frontends/jp/cmd_message.py Thu Feb 28 18:57:28 2019 +0100 +++ b/sat_frontends/jp/cmd_message.py Fri Mar 01 12:11:16 2019 +0100 @@ -224,6 +224,16 @@ self.parser.add_argument( "-m", "--max", dest="rsm_max", type=int, default=20, help=_(u"maximum number of items to retrieve, using RSM (default: 20))")) + rsm_page_group = self.parser.add_mutually_exclusive_group() + rsm_page_group.add_argument( + "-a", "--after", dest="rsm_after", type=base.unicode_decoder, + help=_(u"find page after this item"), metavar='ITEM_ID') + rsm_page_group.add_argument( + "-b", "--before", dest="rsm_before", type=base.unicode_decoder, + help=_(u"find page before this item"), metavar='ITEM_ID') + rsm_page_group.add_argument( + "--index", dest="rsm_index", type=int, + help=_(u"index of the page to retrieve")) def _sessionInfosGetCb(self, session_info, data, metadata): self.host.own_jid = jid.JID(session_info[u"jid"]) @@ -256,8 +266,11 @@ extra[u"mam_end"] = float(self.args.mam_end) if self.args.mam_with is not None: extra[u"mam_with"] = self.args.mam_with - if self.args.rsm_max is not None: - extra[u"rsm_max"] = self.args.rsm_max + for suff in ('max', 'after', 'before', 'index'): + key = u'rsm_' + suff + value = getattr(self.args,key) + if value is not None: + extra[key] = unicode(value) self.host.bridge.MAMGet( self.args.service, data_format.serialise(extra), self.profile, callback=self._MAMGetCb, errback=self.errback)