diff frontends/src/bridge/DBus.py @ 752:f49945d728de

core,bridge: sendMessage bridge method is now async
author Goffi <goffi@goffi.org>
date Tue, 17 Dec 2013 01:46:45 +0100
parents 648511e42a69
children e3ad48a2aab2
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py	Tue Dec 17 00:56:39 2013 +0100
+++ b/frontends/src/bridge/DBus.py	Tue Dec 17 01:46:45 2013 +0100
@@ -196,8 +196,8 @@
     def registerNewAccount(self, login, password, email, host, port=5222):
         return unicode(self.db_core_iface.registerNewAccount(login, password, email, host, port))
 
-    def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@"):
-        return self.db_core_iface.sendMessage(to_jid, message, subject, mess_type, extra, profile_key)
+    def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
+        return self.db_core_iface.sendMessage(to_jid, message, subject, mess_type, extra, profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
 
     def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
         return self.db_core_iface.setParam(name, value, category, security_limit, profile_key)