forked from MirrorHub/mautrix-whatsapp
Update mautrix-go
This commit is contained in:
parent
6df2ff7259
commit
1b31a36e60
3 changed files with 8 additions and 16 deletions
|
@ -99,7 +99,7 @@ func (br *WABridge) newDoublePuppetClient(mxid id.UserID, accessToken string) (*
|
|||
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 {
|
||||
|
@ -111,15 +111,7 @@ func (br *WABridge) newDoublePuppetClient(mxid id.UserID, accessToken string) (*
|
|||
return nil, fmt.Errorf("double puppeting from %s is not allowed", homeserver)
|
||||
}
|
||||
}
|
||||
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) newCustomIntent() (*appservice.IntentAPI, error) {
|
||||
|
|
4
go.mod
4
go.mod
|
@ -16,7 +16,7 @@ require (
|
|||
golang.org/x/net v0.6.0
|
||||
google.golang.org/protobuf v1.28.1
|
||||
maunium.net/go/maulogger/v2 v2.4.1
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230308151314-83fcdcf30f00
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155
|
||||
)
|
||||
|
||||
require (
|
||||
|
@ -37,7 +37,7 @@ require (
|
|||
github.com/tidwall/sjson v1.2.5 // indirect
|
||||
github.com/yuin/goldmark v1.5.4 // indirect
|
||||
go.mau.fi/libsignal v0.1.0 // indirect
|
||||
go.mau.fi/zeroconfig v0.1.1 // indirect
|
||||
go.mau.fi/zeroconfig v0.1.2 // indirect
|
||||
golang.org/x/crypto v0.6.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/text v0.7.0 // indirect
|
||||
|
|
8
go.sum
8
go.sum
|
@ -69,8 +69,8 @@ go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
|
|||
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230306190159-5caded34a872 h1:jrIWy0l9kTxl7bdp3muFofZcyLyI1xxE7BXWeldVKr0=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230306190159-5caded34a872/go.mod h1:zoTtv1CupGEyTew7TOwnBmTbHB4pVad2OzjTf5CVwa0=
|
||||
go.mau.fi/zeroconfig v0.1.1 h1:igLhBbCkaO8yxtxCfzy28k3yitzXU43LcOwpWmpBjz4=
|
||||
go.mau.fi/zeroconfig v0.1.1/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
|
||||
go.mau.fi/zeroconfig v0.1.2 h1:DKOydWnhPMn65GbXZOafgkPm11BvFashZWLct0dGFto=
|
||||
go.mau.fi/zeroconfig v0.1.2/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||
|
@ -127,5 +127,5 @@ maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
|
|||
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
|
||||
maunium.net/go/maulogger/v2 v2.4.1 h1:N7zSdd0mZkB2m2JtFUsiGTQQAdP0YeFWT7YMc80yAL8=
|
||||
maunium.net/go/maulogger/v2 v2.4.1/go.mod h1:omPuYwYBILeVQobz8uO3XC8DIRuEb5rXYlQSuqrbCho=
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230308151314-83fcdcf30f00 h1:tlEAjIGSnxZd2MDvgAIw946KoxqWQq/SJDEchoCJM0M=
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230308151314-83fcdcf30f00/go.mod h1:Ay2u2JljEKX2rEfA2Ss8Wxkj1tkAhUClpA+exZc7imk=
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155 h1:pDeyBttUOnaNUqtu0ZV3fNkEkChAsVZlVekLpzCj6R8=
|
||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155/go.mod h1:1v8QVDd7q/eJ+eg4sgeOSEafBAFhkt4ab2i97M3IkNQ=
|
||||
|
|
Loading…
Reference in a new issue