comparison src/plugins/plugin_misc_groupblog.py @ 847:071524bfcc7d

plugin groupblog: do not log error message when asking for the entries of a non existent node (e.g the contact hasn't posted any message yet)
author souliane <souliane@mailoo.org>
date Tue, 18 Feb 2014 14:35:30 +0100
parents c4b22aedb7d7
children 660b3f5b6c78
comparison
equal deleted inserted replaced
846:59d486726577 847:071524bfcc7d
623 max_items=max_items, profile_key=profile_key) 623 max_items=max_items, profile_key=profile_key)
624 d.addCallback(self._itemsConstruction, jid_, client) 624 d.addCallback(self._itemsConstruction, jid_, client)
625 d.addCallback(lambda gbdata, source_jid: (source_jid, gbdata), jid_.full()) 625 d.addCallback(lambda gbdata, source_jid: (source_jid, gbdata), jid_.full())
626 626
627 mblogs.append(d) 627 mblogs.append(d)
628 dlist = defer.DeferredList(mblogs) 628 # consume the failure "StanzaError with condition u'item-not-found'"
629 # when the node doesn't exist (e.g that JID hasn't posted any message)
630 dlist = defer.DeferredList(mblogs, consumeErrors=True)
629 dlist.addCallback(sendResult) 631 dlist.addCallback(sendResult)
630 632
631 return dlist 633 return dlist
632 634
633 #TODO: custom exception 635 #TODO: custom exception
680 mblogs = [] 682 mblogs = []
681 for jid_ in jids: 683 for jid_ in jids:
682 d = self.host.plugins["XEP-0060"].subscribe(client.item_access_pubsub, self.getNodeName(jid_), 684 d = self.host.plugins["XEP-0060"].subscribe(client.item_access_pubsub, self.getNodeName(jid_),
683 profile_key=profile_key) 685 profile_key=profile_key)
684 mblogs.append(d) 686 mblogs.append(d)
685 dlist = defer.DeferredList(mblogs) 687 # consume the failure "StanzaError with condition u'item-not-found'"
688 # when the node doesn't exist (e.g that JID hasn't posted any message)
689 dlist = defer.DeferredList(mblogs, consumeErrors=True)
686 return dlist 690 return dlist
687 691
688 #TODO: custom exception 692 #TODO: custom exception
689 if publishers_type not in ["GROUP", "JID", "ALL"]: 693 if publishers_type not in ["GROUP", "JID", "ALL"]:
690 raise Exception("Bad call, unknown publishers_type") 694 raise Exception("Bad call, unknown publishers_type")