1
0
Fork 0
mirror of https://codeberg.org/june64/mrvc.git synced 2026-01-10 16:06:33 +01:00

properly discover and use the homeserver client API url for the client

This makes the program actually work for cases, where the client API is
under a different subdomain (like "matrix.hamburg.ccc.de" with the user
id having "hamburg.ccc.de").
This commit is contained in:
June 2025-08-17 04:38:05 +02:00
commit cbba786b5c
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -288,8 +288,15 @@ func main() {
if err != nil {
log.Fatal(err)
}
clientWellKnown, err := mautrix.DiscoverClientAPI(context.Background(), homeserver)
if err != nil {
log.Fatal(err)
}
homeserverURL := clientWellKnown.Homeserver.BaseURL
client, err := mautrix.NewClient(
homeserver,
homeserverURL,
userId,
config.Token,
)