add jitsi to well-known config

This commit is contained in:
Girish Ramakrishnan
2021-12-03 19:16:30 -08:00
parent 8028b93f53
commit 8cbdea57d8
3 changed files with 20 additions and 3 deletions

View File

@@ -131,6 +131,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
domain: null,
mastodonHostname: '',
matrixHostname: '',
jitsiHostname: '',
reset: function () {
$scope.domainWellKnown.busy = false;
@@ -139,6 +140,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainWellKnown.matrixHostname = '';
$scope.domainWellKnown.mastodonHostname = '';
$scope.domainWellKnown.jitsiHostname = '';
},
show: function (domain) {
@@ -153,6 +155,12 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
if (domain.wellKnown && domain.wellKnown['host-meta']) {
$scope.domainWellKnown.mastodonHostname = domain.wellKnown['host-meta'].match(new RegExp('template="https://(.*?)/'))[1];
}
if (domain.wellKnown && domain.wellKnown['matrix/client']) {
let parsed = JSON.parse(domain.wellKnown['matrix/client']);
if (parsed['im.vector.riot.jitsi'] && parsed['im.vector.riot.jitsi']['preferredDomain']) {
$scope.domainWellKnown.jitsiHostname = parsed['im.vector.riot.jitsi']['preferredDomain'];
}
}
} catch (e) {
console.error(e);
}
@@ -171,6 +179,9 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
wellKnown['matrix/client'] = JSON.stringify({
'm.homeserver': {
'base_url': 'https://' + $scope.domainWellKnown.matrixHostname
},
'im.vector.riot.jitsi': {
'preferredDomain': $scope.domainWellKnown.jitsiHostname
}
});
}