changeset 297:19bcd39c77f6

server side: sendMessage is now async
author Goffi <goffi@goffi.org>
date Tue, 17 Dec 2013 01:36:57 +0100
parents 92d76ab67156
children e99f578c7179
files libervia.tac
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libervia.tac	Tue Dec 17 01:35:59 2013 +0100
+++ b/libervia.tac	Tue Dec 17 01:36:57 2013 +0100
@@ -229,22 +229,22 @@
         self.sat_host.bridge.setPresence('', presence, 0, {'': status}, profile)
 
 
-    def jsonrpc_sendMessage(self, to_jid, msg, subject, _type, options={}):
+    def jsonrpc_sendMessage(self, to_jid, msg, subject, type_, options={}):
         """send message"""
         profile = ISATSession(self.session).profile
-        return self.sat_host.bridge.sendMessage(to_jid, msg, subject, _type, options, profile)
+        return self.asyncBridgeCall("sendMessage", to_jid, msg, subject, type_, options, profile)
 
-    def jsonrpc_sendMblog(self, _type, dest, text, extra={}):
+    def jsonrpc_sendMblog(self, type_, dest, text, extra={}):
         """ Send microblog message
-        @param _type: one of "PUBLIC", "GROUP"
+        @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":
+        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, extra, profile)