Update mautrix-go

This commit is contained in:
Tulir Asokan
2023-03-15 16:21:53 +02:00
parent 46115fafd5
commit 3cdf018c37
3 changed files with 8 additions and 18 deletions

View File

@@ -26,7 +26,7 @@ func (br *DiscordBridge) newDoublePuppetClient(mxid id.UserID, accessToken strin
homeserverURL, found := br.Config.Bridge.DoublePuppetServerMap[homeserver]
if !found {
if homeserver == br.AS.HomeserverDomain {
homeserverURL = br.AS.HomeserverURL
homeserverURL = ""
} else if br.Config.Bridge.DoublePuppetAllowDiscovery {
resp, err := mautrix.DiscoverClientAPI(homeserver)
if err != nil {
@@ -40,17 +40,7 @@ func (br *DiscordBridge) newDoublePuppetClient(mxid id.UserID, accessToken strin
}
}
client, err := mautrix.NewClient(homeserverURL, mxid, accessToken)
if err != nil {
return nil, err
}
client.Log = br.AS.Log.With().Str("as_user_id", mxid.String()).Logger()
client.StateStore = br.AS.StateStore
client.Client = br.AS.HTTPClient
client.DefaultHTTPRetries = br.AS.DefaultHTTPRetries
return client, nil
return br.AS.NewExternalMautrixClient(mxid, accessToken, homeserverURL)
}
func (puppet *Puppet) clearCustomMXID() {