# HG changeset patch # User souliane # Date 1424997934 -3600 # Node ID e1d067378ad34f0e2535fc890f44cfaeb6aeaac0 # Parent 0262fee86375e05f2a6fc656c487778cfe313e58 browser_side: fixes sending/updating blog message/comment diff -r 0262fee86375 -r e1d067378ad3 src/browser/sat_browser/blog.py --- a/src/browser/sat_browser/blog.py Fri Feb 27 01:11:34 2015 +0100 +++ b/src/browser/sat_browser/blog.py Fri Feb 27 01:45:34 2015 +0100 @@ -199,7 +199,7 @@ extra.update({'content_rich': content['text'], 'title': content['title']}) if self.empty: if self.type == 'main_item': - self._blog_panel.host.bridge.call('sendMblog', None, None, self._blog_panel.accepted_groups, content['text'], extra) + self._blog_panel.host.bridge.call('sendMblog', None, None, tuple(self._blog_panel.accepted_groups), content['text'], extra) else: self._blog_panel.host.bridge.call('sendMblogComment', None, self._parent_entry.comments, content['text'], extra) else: @@ -479,13 +479,13 @@ comments_url = self.selected_entry.comments if not comments_url: raise Exception("ERROR: the comments URL is empty") + self.bridge.call("sendMblogComment", None, comments_url, text, {}) target = ("COMMENT", comments_url) elif not self.accepted_groups: # we are entering a public microblog - target = ("PUBLIC", None) + self.bridge.call("sendMblog", None, "PUBLIC", (), text, {}) else: - target = ("GROUP", self.accepted_groups) - self.host.send([target], text) + self.bridge.call("sendMblog", None, "GROUP", tuple(self.accepted_groups), text, {}) def accept_all(self): return not self.accepted_groups # we accept every microblog only if we are not filtering by groups diff -r 0262fee86375 -r e1d067378ad3 src/server/server.py --- a/src/server/server.py Fri Feb 27 01:11:34 2015 +0100 +++ b/src/server/server.py Fri Feb 27 01:45:34 2015 +0100 @@ -243,9 +243,9 @@ def jsonrpc_sendMblog(self, type_, dest, text, extra={}): """ Send microblog message - @param type_: one of "PUBLIC", "GROUP" - @param dest: destinees (list of groups, ignored for "PUBLIC") - @param text: microblog's text + @param type_ (unicode): one of "PUBLIC", "GROUP" + @param dest (tuple(unicode)): recipient groups (ignored for "PUBLIC") + @param text (unicode): microblog's text """ profile = ISATSession(self.session).profile extra['allow_comments'] = 'True' @@ -257,7 +257,7 @@ if type_ == "PUBLIC": #This text if for the public microblog log.debug("sending public blog") - return self.sat_host.bridge.sendGroupBlog("PUBLIC", [], text, extra, profile) + return self.sat_host.bridge.sendGroupBlog("PUBLIC", (), text, extra, profile) else: log.debug("sending group blog") dest = dest if isinstance(dest, list) else [dest]