diff src/browser/libervia_main.py @ 869:fa7703642c0e

server, browser: replaced isRegistered call by a more generic getSessionMetadata which return a dictionary
author Goffi <goffi@goffi.org>
date Mon, 29 Feb 2016 12:37:45 +0100
parents 6f0a127077c4
children 54f6c5b86a87
line wrap: on
line diff
--- a/src/browser/libervia_main.py	Sun Feb 28 11:54:14 2016 +0100
+++ b/src/browser/libervia_main.py	Mon Feb 29 12:37:45 2016 +0100
@@ -95,7 +95,7 @@
         self._register = json.RegisterCall()
         self._register.call('getMenus', self.gotMenus)
         self._register.call('registerParams', None)
-        self._register.call('isRegistered', self._isRegisteredCB)
+        self._register.call('getSessionMetadata', self._getSessionMetadataCB)
         self.initialised = False
         self.init_cache = []  # used to cache events until initialisation is done
         self.cached_params = {}
@@ -321,9 +321,9 @@
         # XXX: temp, will be reworked in the backed static blog plugin
         self.menus.addMenu(C.MENU_JID_CONTEXT, (D_(u"User"), D_("Public blog")), callback=main_menu.onPublicBlog)
 
-    def _isRegisteredCB(self, result):
-        registered, warning = result
-        if not registered:
+    def _getSessionMetadataCB(self, metadata):
+        if not metadata['plugged']:
+            warning = metadata.get("warning")
             self.panel.setStyleAttribute("opacity", "0.25")  # set background transparency
             self._register_box = register.RegisterBox(self.logged)
             self._register_box.centerBox()