fix reading matrix config

This commit is contained in:
Girish Ramakrishnan
2021-01-26 22:07:21 -08:00
parent de74b05703
commit 3a26f63c2a

View File

@@ -229,8 +229,8 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainConfigure.mastodonHostname = '';
try {
if (domain.wellKnown && domain.wellKnown['matrix']) {
$scope.domainConfigure.matrixHostname = JSON.parse(domain.wellKnown['matrix'])['m.server'];
if (domain.wellKnown && domain.wellKnown['matrix/server']) {
$scope.domainConfigure.matrixHostname = JSON.parse(domain.wellKnown['matrix/server'])['m.server'];
}
if (domain.wellKnown && domain.wellKnown['host-meta']) {
$scope.domainConfigure.mastodonHostname = domain.wellKnown['host-meta'].match(new RegExp('template="https://(.*?)/'))[1];
@@ -317,7 +317,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
var wellKnown = {};
if ($scope.domainConfigure.matrixHostname) {
wellKnown['matrix'] = JSON.stringify({ 'm.server': $scope.domainConfigure.matrixHostname });
wellKnown['matrix/server'] = JSON.stringify({ 'm.server': $scope.domainConfigure.matrixHostname });
}
if ($scope.domainConfigure.mastodonHostname) {
wellKnown['host-meta'] = '<?xml version="1.0" encoding="UTF-8"?>\n'