Browse Source

feat(external-api) Expose deployment info through API

- Set region along shard from xmpp
master
hmuresan 4 years ago
parent
commit
7102ad1186

+ 3
- 0
modules/API/API.js View File

@@ -560,6 +560,9 @@ function initCommands() {
560 560
                     });
561 561
                 });
562 562
             break;
563
+        case 'deployment-info':
564
+            callback(APP.store.getState()['features/base/config'].deploymentInfo);
565
+            break;
563 566
         case 'invite': {
564 567
             const { invitees } = request;
565 568
 

+ 11
- 0
modules/API/external/external_api.js View File

@@ -956,6 +956,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
956 956
         return avatarURL;
957 957
     }
958 958
 
959
+    /**
960
+     * Gets the deployment info.
961
+     *
962
+     * @returns {Promise} - Resolves with the deployment info object.
963
+     */
964
+    getDeploymentInfo() {
965
+        return this._transport.sendRequest({
966
+            name: 'deployment-info'
967
+        });
968
+    }
969
+
959 970
     /**
960 971
      * Returns the display name of a participant.
961 972
      *

+ 5
- 0
resources/prosody-plugins/mod_jiconop.lua View File

@@ -10,6 +10,11 @@ if shard_name_config then
10 10
     module:add_identity("server", "shard", shard_name_config);
11 11
 end
12 12
 
13
+local region_name_config = module:get_option_string('region_name');
14
+if region_name_config then
15
+    module:add_identity("server", "region", region_name_config);
16
+end
17
+
13 18
 -- this is after xmpp-bind, the moment a client has resource and can be contacted
14 19
 module:hook("resource-bind", function (event)
15 20
     local session = event.session;

Loading…
Cancel
Save