about summary refs log tree commit diff
path: root/LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
commit1d6399d7f4649472333da946669ce9f1fa349b89 (patch)
tree95baedad8e42956de6d4d339d5c4fdc44ae2396b /LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs
parentsplit client and server http client for homeservers (diff)
downloadLibMatrix-bak-1d6399d7f4649472333da946669ce9f1fa349b89.tar.xz
Cleanup, fixes, fix proxy support
Diffstat (limited to 'LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs')
-rw-r--r--LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs10
1 files changed, 3 insertions, 7 deletions
diff --git a/LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs b/LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs
index 0910cbe..15e5b65 100644
--- a/LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs
+++ b/LibMatrix/Homeservers/AuthenticatedHomeserverSynapse.cs
@@ -6,11 +6,7 @@ namespace LibMatrix.Homeservers;
 
 public class AuthenticatedHomeserverSynapse : AuthenticatedHomeserverGeneric {
     public readonly SynapseAdminApi Admin;
-    public class SynapseAdminApi {
-        private readonly AuthenticatedHomeserverGeneric _authenticatedHomeserver;
-
-        public SynapseAdminApi(AuthenticatedHomeserverGeneric authenticatedHomeserver) => _authenticatedHomeserver = authenticatedHomeserver;
-
+    public class SynapseAdminApi(AuthenticatedHomeserverSynapse authenticatedHomeserver) {
         public async IAsyncEnumerable<AdminRoomListingResult.AdminRoomListingResultRoom> SearchRoomsAsync(int limit = int.MaxValue, string orderBy = "name", string dir = "f", string? searchTerm = null, LocalRoomQueryFilter? localFilter = null) {
             AdminRoomListingResult? res = null;
             var i = 0;
@@ -23,7 +19,7 @@ public class AuthenticatedHomeserverSynapse : AuthenticatedHomeserverGeneric {
 
                 Console.WriteLine($"--- ADMIN Querying Room List with URL: {url} - Already have {i} items... ---");
 
-                res = await _authenticatedHomeserver.ClientHttpClient.GetFromJsonAsync<AdminRoomListingResult>(url);
+                res = await authenticatedHomeserver.ClientHttpClient.GetFromJsonAsync<AdminRoomListingResult>(url);
                 totalRooms ??= res?.TotalRooms;
                 Console.WriteLine(res.ToJson(false));
                 foreach (var room in res.Rooms) {
@@ -101,7 +97,7 @@ public class AuthenticatedHomeserverSynapse : AuthenticatedHomeserverGeneric {
         }
     }
 
-    public AuthenticatedHomeserverSynapse(string baseUrl, string accessToken) : base(baseUrl, accessToken) {
+    public AuthenticatedHomeserverSynapse(string serverName, string accessToken) : base(serverName, accessToken) {
         Admin = new(this);
     }
 }