Update mautrix-go
This commit is contained in:
@@ -26,7 +26,7 @@ func (br *DiscordBridge) newDoublePuppetClient(mxid id.UserID, accessToken strin
|
|||||||
homeserverURL, found := br.Config.Bridge.DoublePuppetServerMap[homeserver]
|
homeserverURL, found := br.Config.Bridge.DoublePuppetServerMap[homeserver]
|
||||||
if !found {
|
if !found {
|
||||||
if homeserver == br.AS.HomeserverDomain {
|
if homeserver == br.AS.HomeserverDomain {
|
||||||
homeserverURL = br.AS.HomeserverURL
|
homeserverURL = ""
|
||||||
} else if br.Config.Bridge.DoublePuppetAllowDiscovery {
|
} else if br.Config.Bridge.DoublePuppetAllowDiscovery {
|
||||||
resp, err := mautrix.DiscoverClientAPI(homeserver)
|
resp, err := mautrix.DiscoverClientAPI(homeserver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -40,17 +40,7 @@ func (br *DiscordBridge) newDoublePuppetClient(mxid id.UserID, accessToken strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := mautrix.NewClient(homeserverURL, mxid, accessToken)
|
return br.AS.NewExternalMautrixClient(mxid, accessToken, homeserverURL)
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (puppet *Puppet) clearCustomMXID() {
|
func (puppet *Puppet) clearCustomMXID() {
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -15,7 +15,7 @@ require (
|
|||||||
github.com/stretchr/testify v1.8.1
|
github.com/stretchr/testify v1.8.1
|
||||||
github.com/yuin/goldmark v1.5.4
|
github.com/yuin/goldmark v1.5.4
|
||||||
maunium.net/go/maulogger/v2 v2.4.1
|
maunium.net/go/maulogger/v2 v2.4.1
|
||||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230305213109-d1b5e5b49214
|
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -28,7 +28,7 @@ require (
|
|||||||
github.com/tidwall/match v1.1.1 // indirect
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
github.com/tidwall/pretty v1.2.0 // indirect
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
github.com/tidwall/sjson v1.2.5 // indirect
|
github.com/tidwall/sjson v1.2.5 // indirect
|
||||||
go.mau.fi/zeroconfig v0.1.0 // indirect
|
go.mau.fi/zeroconfig v0.1.2 // indirect
|
||||||
golang.org/x/crypto v0.6.0 // indirect
|
golang.org/x/crypto v0.6.0 // indirect
|
||||||
golang.org/x/net v0.6.0 // indirect
|
golang.org/x/net v0.6.0 // indirect
|
||||||
golang.org/x/sys v0.5.0 // indirect
|
golang.org/x/sys v0.5.0 // indirect
|
||||||
|
|||||||
8
go.sum
8
go.sum
@@ -50,8 +50,8 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
|
|||||||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
||||||
github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=
|
github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=
|
||||||
github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.mau.fi/zeroconfig v0.1.0 h1:SDGgreQevNJHb+QqGAs2Ff+OPXcGdO8rZencqP4BJi4=
|
go.mau.fi/zeroconfig v0.1.2 h1:DKOydWnhPMn65GbXZOafgkPm11BvFashZWLct0dGFto=
|
||||||
go.mau.fi/zeroconfig v0.1.0/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
|
go.mau.fi/zeroconfig v0.1.2/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
|
||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||||
@@ -82,5 +82,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/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 h1:N7zSdd0mZkB2m2JtFUsiGTQQAdP0YeFWT7YMc80yAL8=
|
||||||
maunium.net/go/maulogger/v2 v2.4.1/go.mod h1:omPuYwYBILeVQobz8uO3XC8DIRuEb5rXYlQSuqrbCho=
|
maunium.net/go/maulogger/v2 v2.4.1/go.mod h1:omPuYwYBILeVQobz8uO3XC8DIRuEb5rXYlQSuqrbCho=
|
||||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230305213109-d1b5e5b49214 h1:IGC9ueWSNpHFci6EgWDUV3IHzTyWpLSOeU+CQKpRvd4=
|
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155 h1:pDeyBttUOnaNUqtu0ZV3fNkEkChAsVZlVekLpzCj6R8=
|
||||||
maunium.net/go/mautrix v0.15.0-beta.2.0.20230305213109-d1b5e5b49214/go.mod h1:AE3TCX9q4W7fYfrL/1RsuOell9rTUBO27XUULuwArH4=
|
maunium.net/go/mautrix v0.15.0-beta.2.0.20230315141952-7b3389a2c155/go.mod h1:1v8QVDd7q/eJ+eg4sgeOSEafBAFhkt4ab2i97M3IkNQ=
|
||||||
|
|||||||
Reference in New Issue
Block a user