# HG changeset patch # User Goffi # Date 1384524407 -3600 # Node ID a20815c75c156aa59a2fef3560f715c9e2cafe25 # Parent 53c7f0237f1e65ae5b002e044b77b1e99a2db0d6 server_side: extra data is now added for sendMblog, allowing to send rich text with the 'rich' key. diff -r 53c7f0237f1e -r a20815c75c15 libervia.tac --- 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")