diff libervia.py @ 242:a25aa882e09a

browser_side: add context menu for contact: - for now only when a blog exists on the current libervia's server - retrieve the server domain with the bridge method getNewAccountDomain - getNewAccountDomain is also used to display the current libervia domain in the dialogs (new contact default domain, messages for invalid contact or group)
author souliane <souliane@mailoo.org>
date Fri, 18 Oct 2013 11:14:55 +0200
parents b911f2b43fd4
children 43a27ffc74df
line wrap: on
line diff
--- a/libervia.py	Tue Oct 15 13:36:51 2013 +0200
+++ b/libervia.py	Fri Oct 18 11:14:55 2013 +0200
@@ -118,9 +118,10 @@
                          "tarotGameContratChoosed", "tarotGamePlayCards", "launchRadioCollective",
                          "getWaitingSub", "subscription", "delContact", "updateContact", "getCard",
                          "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction",
-                         "disconnect", "chatStateComposing"
+                         "disconnect", "chatStateComposing", "getNewAccountDomain"
                         ])
 
+
 class BridgeSignals(LiberviaJsonProxy):
     RETRY_BASE_DELAY = 1000
 
@@ -305,6 +306,15 @@
         #We want to know our own jid
         self.bridge.call('getProfileJid', self._getProfileJidCB)
 
+        def domain_cb(value):
+            self._defaultDomain = value
+            print("new account domain: %s" % value)
+
+        def domain_eb(value):
+            self._defaultDomain = "libervia.org"
+
+        self.bridge.call("getNewAccountDomain", (domain_cb, domain_eb))
+
     def _getContactsCB(self, contacts_data):
         for contact in contacts_data:
             jid, attributes, groups = contact
@@ -575,7 +585,6 @@
             if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
                 getattr(lib_wid.getGame("RadioCol"), event_name)(*args)
 
-
     def _getPresenceStatusCb(self, presence_data):
         for entity in presence_data:
             for resource in presence_data[entity]: