diff src/browser/sat_browser/json.py @ 914:0c0551967bdf

server, browser: partial Libervia fix Libervia was broken following the refactorings. This commit partially fixes it : Libervia is starting, avatar, blog and message are working again, but not everything is restablished yet. following things have been fixed/changed: - new dependency: shortuuid - D-Bus bridge is working again - fixed naming in several bridge methods - register method changed to register_signal - fixed Chat widget, which was not working anymore since the refactoring - avatar now use avatarGet. Cache dir is accessible using a session specific uuid, to avoid cache leak (i.e. accessing cache of other profiles) - server: new uuid attribute in session data Browser code is not fully working yet, notably OTR and contact list are not fully fixed.
author Goffi <goffi@goffi.org>
date Sun, 26 Feb 2017 18:32:47 +0100
parents 58f611481e6d
children cf527974a0fa
line wrap: on
line diff
--- a/src/browser/sat_browser/json.py	Sun Aug 28 19:25:52 2016 +0200
+++ b/src/browser/sat_browser/json.py	Sun Feb 26 18:32:47 2017 +0100
@@ -167,7 +167,7 @@
 class RegisterCall(LiberviaJsonProxy):
     def __init__(self):
         LiberviaJsonProxy.__init__(self, "/register_api",
-                        ["getSessionMetadata", "isConnected", "asyncConnect", "registerParams", "getMenus"])
+                        ["getSessionMetadata", "isConnected", "connect", "registerParams", "menusGet"])
 
 
 class BridgeCall(LiberviaJsonProxy):
@@ -177,10 +177,10 @@
                          "psDeleteNode", "psRetractItem", "psRetractItems",
                          "mbSend", "mbRetract", "mbGet", "mbGetFromMany", "mbGetFromManyRTResult",
                          "mbGetFromManyWithComments", "mbGetFromManyWithCommentsRTResult",
-                         "getHistory", "getPresenceStatuses", "joinMUC", "mucLeave", "mucGetRoomsJoined",
+                         "historyGet", "getPresenceStatuses", "joinMUC", "mucLeave", "mucGetRoomsJoined",
                          "inviteMUC", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady",
                          "tarotGamePlayCards", "launchRadioCollective",
-                         "getWaitingSub", "subscription", "delContact", "updateContact", "getCard",
+                         "getWaitingSub", "subscription", "delContact", "updateContact", "avatarGet",
                          "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction",
                          "disconnect", "chatStateComposing", "getNewAccountDomain",
                          "syntaxConvert", "getAccountDialogUI", "getMainResource", "getEntitiesData",
@@ -194,15 +194,12 @@
         log.warning("getConfig is not implemeted in Libervia yet")
         return ''
 
-    def isConnected(self, dummy): # FIXME
+    def isConnected(self, dummy, callback): # FIXME
         log.warning("isConnected is not implemeted in Libervia as for now profile is connected if session is opened")
-        return True
+        callback(True)
 
-    def getAvatarFile(self, hash_, callback=None):
-        log.warning("getAvatarFile only return hash in Libervia")
-        if callback is not None:
-            callback(hash_)
-        return hash_
+    def bridgeConnect(self, callback, errback):
+        callback()
 
 
 class BridgeSignals(LiberviaJsonProxy):
@@ -263,7 +260,7 @@
             self.retry_timer.scheduleRepeating(1000)
             _timerCb(None)
 
-    def register(self, name, callback, with_profile=True):
+    def register_signal(self, name, callback, with_profile=True):
         """Register a signal
 
         @param: name of the signal to register