fix reading matrix config
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user