about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 20:34:16 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 20:34:16 +0200
commit383f7b633471dedf515907cb8a8752bc5885ae64 (patch)
tree793225216c9c38be1533e1960166b7b3dd472890 /MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor
parentDark theme, fancier room list (diff)
downloadMatrixUtils-383f7b633471dedf515907cb8a8752bc5885ae64.tar.xz
Add room manager, profile caching
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor')
-rw-r--r--MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor40
1 files changed, 1 insertions, 39 deletions
diff --git a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor
index 5656af9..e9d1be4 100644
--- a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor
+++ b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor
@@ -57,7 +57,7 @@ else
         totalRoomCount = xxxrooms.Count;
         StateHasChanged();
 
-        var xxxsemaphore = new SemaphoreSlim(256);
+        var xxxsemaphore = new SemaphoreSlim(1000);
         var xxxtasks = new List<Task<PolicyRoomInfo?>>();
         foreach (var room in xxxrooms)
         {
@@ -68,44 +68,6 @@ else
 
         Console.WriteLine($"Detected policy lists: {PolicyRoomList.ToJson()}");
         return;
-    /*
-        using HttpClient wc = new();
-        wc.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalStorageWrapper.AccessToken);
-
-        
-        
-    //get room list
-    //temporary hack until rooms get enumerated...
-        string[] rooms = { "!fTjMjIzNKEsFlUIiru:neko.dev" };
-        var _rooms = await wc.GetAsync($"{LocalStorageWrapper.CurrentHomeserver}/_matrix/client/v3/joined_rooms");
-        Console.WriteLine($"Got {_rooms.StatusCode}...");
-        if (!_rooms.IsSuccessStatusCode)
-        {
-            Console.WriteLine($"Failed to get rooms: {await _rooms.Content.ReadAsStringAsync()}");
-            return;
-        }
-        var _rooms_o = await _rooms.Content.ReadFromJsonAsync<JsonElement>();
-        if (_rooms_o.TryGetProperty("joined_rooms", out JsonElement _rooms_j))
-        {
-            rooms = _rooms_j.EnumerateArray().Select(x => x.GetString()).ToArray();
-        }
-
-        totalRoomCount = rooms.Length;
-        StateHasChanged();
-
-        var semaphore = new SemaphoreSlim(256);
-        var tasks = new List<Task<PolicyRoomInfo?>>();
-        foreach (string room in rooms)
-        {
-            tasks.Add(GetPolicyRoomInfo(room, semaphore));
-        }
-        var results = await Task.WhenAll(tasks);
-        PolicyRoomList.AddRange(results.Where(x => x != null).Select(x => x.Value));
-
-
-    //print to console
-        Console.WriteLine($"Detected policy lists: {PolicyRoomList.ToJson()}");
-        */
     }
 
     private async Task<PolicyRoomInfo?> GetPolicyRoomInfo(string room, SemaphoreSlim semaphore)