From 888adbf10020efa1ab0c2d429c7f8e7ffb23f97c Mon Sep 17 00:00:00 2001 From: John Hess Date: Fri, 25 Feb 2022 14:43:36 -0600 Subject: [PATCH] support defaultServer with http-only connectivity --- src/models/user.js | 7 ------- src/services/matrix.service.js | 11 ++--------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/models/user.js b/src/models/user.js index 6217ec3..1f423d2 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -14,13 +14,6 @@ export default class User { } }; - static homeServerUrl = function (home_server) { - if (home_server && !home_server.startsWith("https://")) { - return "https://" + home_server; - } - return home_server; - }; - static localPart(user_id) { if (user_id && user_id.startsWith('@') && user_id.includes(':')) { const parts = user_id.split(":"); diff --git a/src/services/matrix.service.js b/src/services/matrix.service.js index ff72395..8401bf0 100644 --- a/src/services/matrix.service.js +++ b/src/services/matrix.service.js @@ -102,9 +102,7 @@ export default { return new LocalStorageCryptoStore(this.$store.getters.storage); }, login(user) { - const tempMatrixClient = sdk.createClient( - User.homeServerUrl(user.home_server) - ); + const tempMatrixClient = sdk.createClient(user.home_server); var promiseLogin; const self = this; @@ -236,13 +234,8 @@ export default { this.$store.getters.storage ); - var homeServer = user.home_server; - if (!homeServer.startsWith("https://")) { - homeServer = "https://" + homeServer; - } - var opts = { - baseUrl: homeServer, + baseUrl: user.home_server, userId: user.user_id, store: matrixStore, sessionStore: webStorageSessionStore,