about summary refs log tree commit diff
path: root/LibMatrix/Homeservers/RemoteHomeServer.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-02-09 16:32:46 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2024-02-09 16:32:46 +0100
commit4ef9ae4b396b0eb37036d4008e8cb40e468dbe73 (patch)
tree6bb4d25754fefc52333a5fc44dd721c333314240 /LibMatrix/Homeservers/RemoteHomeServer.cs
parentConsistently use EventId for event types (diff)
downloadLibMatrix-4ef9ae4b396b0eb37036d4008e8cb40e468dbe73.tar.xz
Apply syntax style to LibMatrix
Diffstat (limited to '')
-rw-r--r--LibMatrix/Homeservers/RemoteHomeServer.cs18
1 files changed, 8 insertions, 10 deletions
diff --git a/LibMatrix/Homeservers/RemoteHomeServer.cs b/LibMatrix/Homeservers/RemoteHomeServer.cs
index f47dc4d..5c7d254 100644
--- a/LibMatrix/Homeservers/RemoteHomeServer.cs
+++ b/LibMatrix/Homeservers/RemoteHomeServer.cs
@@ -26,23 +26,21 @@ public class RemoteHomeserver(string baseUrl) {
             proxy = null;
         var homeserver = new RemoteHomeserver(baseUrl);
         homeserver.WellKnownUris = await new HomeserverResolverService().ResolveHomeserverFromWellKnown(baseUrl);
-        if(string.IsNullOrWhiteSpace(homeserver.WellKnownUris.Client))
+        if (string.IsNullOrWhiteSpace(homeserver.WellKnownUris.Client))
             Console.WriteLine($"Failed to resolve homeserver client URI for {baseUrl}");
-        if(string.IsNullOrWhiteSpace(homeserver.WellKnownUris.Server))
+        if (string.IsNullOrWhiteSpace(homeserver.WellKnownUris.Server))
             Console.WriteLine($"Failed to resolve homeserver server URI for {baseUrl}");
-        
-        Console.WriteLine(homeserver.WellKnownUris.ToJson(ignoreNull:false));
-        
-        homeserver.ClientHttpClient = new() {
+
+        Console.WriteLine(homeserver.WellKnownUris.ToJson(ignoreNull: false));
+
+        homeserver.ClientHttpClient = new MatrixHttpClient {
             BaseAddress = new Uri(proxy ?? homeserver.WellKnownUris.Client ?? throw new InvalidOperationException($"Failed to resolve homeserver client URI for {baseUrl}")),
             Timeout = TimeSpan.FromSeconds(120)
         };
-        
+
         homeserver.FederationClient = await FederationClient.TryCreate(baseUrl, proxy);
 
-        if (proxy is not null) {
-            homeserver.ClientHttpClient.DefaultRequestHeaders.Add("MXAE_UPSTREAM", baseUrl);
-        }
+        if (proxy is not null) homeserver.ClientHttpClient.DefaultRequestHeaders.Add("MXAE_UPSTREAM", baseUrl);
 
         return homeserver;
     }