fix home server issue
This commit is contained in:
parent
5f3505dcb0
commit
fae69c4d1a
2 changed files with 7 additions and 1 deletions
|
@ -16,6 +16,7 @@ type MatrixConfig struct {
|
||||||
// In element.io, find it under Settings -> About & Help -> Advanced.
|
// In element.io, find it under Settings -> About & Help -> Advanced.
|
||||||
AccessToken string
|
AccessToken string
|
||||||
RoomId string
|
RoomId string
|
||||||
|
HomeServer string
|
||||||
}
|
}
|
||||||
|
|
||||||
type MatrixClient struct {
|
type MatrixClient struct {
|
||||||
|
@ -31,7 +32,11 @@ func NewMatrixClient(config MatrixConfig) (*MatrixClient, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
user_id := UserID(config.UserId)
|
user_id := UserID(config.UserId)
|
||||||
client, err := m.NewClient(user_id.Homeserver(), user_id, config.AccessToken)
|
homeserver := config.HomeServer
|
||||||
|
if homeserver == "" {
|
||||||
|
homeserver = user_id.Homeserver()
|
||||||
|
}
|
||||||
|
client, err := m.NewClient(homeserver, user_id, config.AccessToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,3 +13,4 @@ service = [
|
||||||
userId = "@exozymebot76397:matrix.org"
|
userId = "@exozymebot76397:matrix.org"
|
||||||
# accessToken = "nil"
|
# accessToken = "nil"
|
||||||
roomId = "!fXEYZcqHcbjztwNhhD:exozy.me"
|
roomId = "!fXEYZcqHcbjztwNhhD:exozy.me"
|
||||||
|
homeserver = "https://chat.exozy.me"
|
||||||
|
|
Loading…
Reference in a new issue