changeset 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 40c72f3b7638
files src/browser/sat_browser/blog.py src/server/server.py
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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]