comparison src/browser/sat_browser/blog.py @ 653:e1d067378ad3 frontends_multi_profiles

browser_side: fixes sending/updating blog message/comment
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 01:45:34 +0100
parents 0262fee86375
children ebb602d8b3f2
comparison
equal deleted inserted replaced
652:0262fee86375 653:e1d067378ad3
197 # the message syntax could be different then the current syntax: pass the 197 # the message syntax could be different then the current syntax: pass the
198 # message syntax in extra for the frontend to use it instead of current syntax. 198 # message syntax in extra for the frontend to use it instead of current syntax.
199 extra.update({'content_rich': content['text'], 'title': content['title']}) 199 extra.update({'content_rich': content['text'], 'title': content['title']})
200 if self.empty: 200 if self.empty:
201 if self.type == 'main_item': 201 if self.type == 'main_item':
202 self._blog_panel.host.bridge.call('sendMblog', None, None, self._blog_panel.accepted_groups, content['text'], extra) 202 self._blog_panel.host.bridge.call('sendMblog', None, None, tuple(self._blog_panel.accepted_groups), content['text'], extra)
203 else: 203 else:
204 self._blog_panel.host.bridge.call('sendMblogComment', None, self._parent_entry.comments, content['text'], extra) 204 self._blog_panel.host.bridge.call('sendMblogComment', None, self._parent_entry.comments, content['text'], extra)
205 else: 205 else:
206 self._blog_panel.host.bridge.call('updateMblog', None, self.__pub_data, self.comments, content['text'], extra) 206 self._blog_panel.host.bridge.call('updateMblog', None, self.__pub_data, self.comments, content['text'], extra)
207 return True 207 return True
477 if self.selected_entry: 477 if self.selected_entry:
478 # we are entering a comment 478 # we are entering a comment
479 comments_url = self.selected_entry.comments 479 comments_url = self.selected_entry.comments
480 if not comments_url: 480 if not comments_url:
481 raise Exception("ERROR: the comments URL is empty") 481 raise Exception("ERROR: the comments URL is empty")
482 self.bridge.call("sendMblogComment", None, comments_url, text, {})
482 target = ("COMMENT", comments_url) 483 target = ("COMMENT", comments_url)
483 elif not self.accepted_groups: 484 elif not self.accepted_groups:
484 # we are entering a public microblog 485 # we are entering a public microblog
485 target = ("PUBLIC", None) 486 self.bridge.call("sendMblog", None, "PUBLIC", (), text, {})
486 else: 487 else:
487 target = ("GROUP", self.accepted_groups) 488 self.bridge.call("sendMblog", None, "GROUP", tuple(self.accepted_groups), text, {})
488 self.host.send([target], text)
489 489
490 def accept_all(self): 490 def accept_all(self):
491 return not self.accepted_groups # we accept every microblog only if we are not filtering by groups 491 return not self.accepted_groups # we accept every microblog only if we are not filtering by groups
492 492
493 def getEntries(self): 493 def getEntries(self):