changeset 259:a20815c75c15

server_side: extra data is now added for sendMblog, allowing to send rich text with the 'rich' key.
author Goffi <goffi@goffi.org>
date Fri, 15 Nov 2013 15:06:47 +0100
parents 53c7f0237f1e
children 533d68585866
files libervia.tac
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libervia.tac	Fri Nov 15 15:01:29 2013 +0100
+++ b/libervia.tac	Fri Nov 15 15:06:47 2013 +0100
@@ -228,21 +228,23 @@
         profile = ISATSession(self.session).profile
         return self.sat_host.bridge.sendMessage(to_jid, msg, subject, _type, options, profile)
 
-    def jsonrpc_sendMblog(self, _type, dest, text):
+    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
         """
         profile = ISATSession(self.session).profile
+        extra['allow_comments'] = 'True'
+
         if _type in ("PUBLIC", "GROUP") and text:
             if _type == "PUBLIC":
                 #This text if for the public microblog
                 print "sending public blog"
-                return self.sat_host.bridge.sendGroupBlog("PUBLIC", [], text, {'allow_comments': 'True'}, profile)
+                return self.sat_host.bridge.sendGroupBlog("PUBLIC", [], text, extra, profile)
             else:
                 print "sending group blog"
-                return self.sat_host.bridge.sendGroupBlog("GROUP", [dest], text, {'allow_comments': 'True'}, profile)
+                return self.sat_host.bridge.sendGroupBlog("GROUP", [dest], text, extra, profile)
         else:
             raise Exception("Invalid data")