aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-04-24 16:23:25 +0000
committerGitHub <noreply@github.com>2023-04-24 16:23:25 +0000
commited19efc5d751446a57727c0880437d95be26ba9d (patch)
tree9c779c3d5df6b06afa0315e24e23b7a650a2a4b0 /setup
parent4679098a6415ea8bfb7728ddafa587780849c059 (diff)
Move fedclient interface over to gmsl (#3061)
Companion PR: https://github.com/matrix-org/gomatrixserverlib/pull/366
Diffstat (limited to 'setup')
-rw-r--r--setup/base/base.go4
-rw-r--r--setup/monolith.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/setup/base/base.go b/setup/base/base.go
index d6c35010..ea342054 100644
--- a/setup/base/base.go
+++ b/setup/base/base.go
@@ -74,7 +74,7 @@ func CreateClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *fclient.Cli
// CreateFederationClient creates a new federation client. Should only be called
// once per component.
-func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *fclient.FederationClient {
+func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) fclient.FederationClient {
identities := cfg.Global.SigningIdentities()
if cfg.Global.DisableFederation {
return fclient.NewFederationClient(
@@ -85,6 +85,7 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *f
fclient.WithTimeout(time.Minute * 5),
fclient.WithSkipVerify(cfg.FederationAPI.DisableTLSValidation),
fclient.WithKeepAlives(!cfg.FederationAPI.DisableHTTPKeepalives),
+ fclient.WithUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString())),
}
if cfg.Global.DNSCache.Enabled {
opts = append(opts, fclient.WithDNSCache(dnsCache))
@@ -92,7 +93,6 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) *f
client := fclient.NewFederationClient(
identities, opts...,
)
- client.SetUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString()))
return client
}
diff --git a/setup/monolith.go b/setup/monolith.go
index e5af6985..d9893042 100644
--- a/setup/monolith.go
+++ b/setup/monolith.go
@@ -43,7 +43,7 @@ type Monolith struct {
Config *config.Dendrite
KeyRing *gomatrixserverlib.KeyRing
Client *fclient.Client
- FedClient *fclient.FederationClient
+ FedClient fclient.FederationClient
AppserviceAPI appserviceAPI.AppServiceInternalAPI
FederationAPI federationAPI.FederationInternalAPI