feat(external-api) Expose deployment info through API

- Set region along shard from xmpp
This commit is contained in:
hmuresan 2021-10-07 14:49:15 +03:00 committed by Дамян Минков
parent 3b33ba3f5d
commit 7102ad1186
3 changed files with 19 additions and 0 deletions

View File

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

View File

@ -956,6 +956,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
return avatarURL;
}
/**
* Gets the deployment info.
*
* @returns {Promise} - Resolves with the deployment info object.
*/
getDeploymentInfo() {
return this._transport.sendRequest({
name: 'deployment-info'
});
}
/**
* Returns the display name of a participant.
*

View File

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