comparison src/browser/sat_browser/blog.py @ 713:d75935e2b279

browser_side (blog): do not fail when target server doesn't handle RSM
author souliane <souliane@mailoo.org>
date Wed, 15 Jul 2015 13:34:17 +0200
parents 531eacb82e9f
children 3b91225b457a
comparison
equal deleted inserted replaced
712:bf562fb9c273 713:d75935e2b279
557 557
558 hashes = set([(entry['service'], entry['node']) for entry in mblogs if entry['type'] == 'comment']) 558 hashes = set([(entry['service'], entry['node']) for entry in mblogs if entry['type'] == 'comment'])
559 assert(len(hashes) < 2) # ensure the blogs come from the same node 559 assert(len(hashes) < 2) # ensure the blogs come from the same node
560 if len(hashes) == 1: 560 if len(hashes) == 1:
561 main_entry = self.comments[hashes.pop()] 561 main_entry = self.comments[hashes.pop()]
562 count = int(rsm['count']) 562 try:
563 hidden = count - (int(rsm['index']) + len(mblogs)) 563 count = int(rsm['count'])
564 main_entry.updateHeader(count, hidden) 564 hidden = count - (int(rsm['index']) + len(mblogs))
565 main_entry.updateHeader(count, hidden)
566 except KeyError: # target pubsub server doesn't support RSM
567 pass
565 568
566 def _chronoInsert(self, vpanel, entry, reverse=True): 569 def _chronoInsert(self, vpanel, entry, reverse=True):
567 """ Insert an entry in chronological order 570 """ Insert an entry in chronological order
568 @param vpanel: VerticalPanel instance 571 @param vpanel: VerticalPanel instance
569 @param entry: MicroblogEntry 572 @param entry: MicroblogEntry