feat: Delegate homeserver

Now if matrix homeserver on matrix.example.com, example.com will be correct too
This commit is contained in:
2025-03-03 18:42:57 +03:00
parent e70049f1f5
commit cab56d6329
4 changed files with 32 additions and 22 deletions
@@ -1,7 +1,7 @@
/*
* Created by sweetbread on 22.02.2025, 15:45
* Created by sweetbread
* Copyright (c) 2025. All rights reserved.
* Last modified 22.02.2025, 15:45
* Last modified 03.03.2025, 15:32
*/
package ru.risdeveau.pixeldragon
@@ -42,9 +42,12 @@ suspend fun initCheck(): Boolean {
if (!accountData.contains("token")) return false
if (!accountData.contains("homeserver")) return false
token = accountData.getString("token", "").toString()
homeserver = accountData.getString("homeserver", "").toString()
baseUrl = "https://$homeserver/_matrix/client/v3"
baseUrl = "$homeserver/_matrix/client/v3"
Log.d("initCheck", "homeserver: $homeserver")
return getMe() != null
}