diff src/plugins/plugin_xep_0277.py @ 2289:f8276bd8baf6

plugin XEP-0277: max_items fix (last "fix" about it was actually bad)
author Goffi <goffi@goffi.org>
date Thu, 29 Jun 2017 23:40:12 +0200
parents 330f8d4e2ad4
children 972e33507609
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py	Thu Jun 29 20:57:14 2017 +0200
+++ b/src/plugins/plugin_xep_0277.py	Thu Jun 29 23:40:12 2017 +0200
@@ -605,7 +605,7 @@
         service = jid.JID(service) if service else None
         max_items = None if max_items == C.NO_LIMIT else max_items
         extra = self._p.parseExtra(extra_dict)
-        return self.mbGet(client, service, node or None, None if max_items==C.NO_LIMIT else None, item_ids, extra.rsm_request, extra.extra)
+        return self.mbGet(client, service, node or None, max_items, item_ids, extra.rsm_request, extra.extra)
 
 
     @defer.inlineCallbacks
@@ -804,7 +804,7 @@
         max_items = None if max_items == C.NO_LIMIT else max_items
         publishers_type, publishers = self._checkPublishers(publishers_type, publishers)
         extra = self._p.parseExtra(extra_dict)
-        return self.mbGetFromMany(publishers_type, publishers, None if max_items==C.NO_LIMIT else max_items, extra.rsm_request, extra.extra, profile_key)
+        return self.mbGetFromMany(publishers_type, publishers, max_items, extra.rsm_request, extra.extra, profile_key)
 
     def mbGetFromMany(self, publishers_type, publishers, max_items=None, rsm_request=None, extra=None, profile_key=C.PROF_KEY_NONE):
         """Get the published microblogs for a list of groups or jids
@@ -861,7 +861,7 @@
         publishers_type, publishers = self._checkPublishers(publishers_type, publishers)
         extra = self._p.parseExtra(extra_dict)
         extra_comments = self._p.parseExtra(extra_comments_dict)
-        return self.mbGetFromManyWithComments(publishers_type, publishers, None if max_items==C.NO_LIMIT else max_items, max_comments or None,
+        return self.mbGetFromManyWithComments(publishers_type, publishers, max_items, max_comments or None,
                                               extra.rsm_request,
                                               extra.extra,
                                               extra_comments.rsm_request,