mirror of
https://codeberg.org/june64/mrvc.git
synced 2026-01-09 23:52:54 +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:
parent
151b9080db
commit
cbba786b5c
1 changed files with 8 additions and 1 deletions
9
main.go
9
main.go
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue