about summary refs log tree commit diff
path: root/MatrixUtils.Web
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-02-23 11:26:00 +0000
committerRory& <root@rory.gay>2024-02-23 11:26:00 +0000
commite12117061631523aa136ff81638abdeb1fb23997 (patch)
treea04688939c6717b4b2e66cadd2939aa0de10f638 /MatrixUtils.Web
parentNew tools, fix room list items (diff)
downloadMatrixUtils-e12117061631523aa136ff81638abdeb1fb23997.tar.xz
HS emulator
Diffstat (limited to 'MatrixUtils.Web')
-rw-r--r--MatrixUtils.Web/Pages/Dev/DevOptions.razor1
-rw-r--r--MatrixUtils.Web/Pages/Dev/DevUtilities.razor3
-rw-r--r--MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor1
-rw-r--r--MatrixUtils.Web/Pages/HSAdmin/RoomQuery.razor1
-rw-r--r--MatrixUtils.Web/Pages/HSEInit.razor37
-rw-r--r--MatrixUtils.Web/Pages/Index.razor133
-rw-r--r--MatrixUtils.Web/Pages/Moderation/DraupnirProtectedRoomsEditor.razor2
-rw-r--r--MatrixUtils.Web/Pages/Moderation/UserRoomHistory.razor2
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Create.razor1
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Index.razor2
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Timeline.razor1
-rw-r--r--MatrixUtils.Web/Pages/ServerInfo.razor1
-rw-r--r--MatrixUtils.Web/Pages/Tools/CopyPowerlevel.razor2
-rw-r--r--MatrixUtils.Web/Pages/Tools/KnownHomeserverList.razor3
-rw-r--r--MatrixUtils.Web/Pages/Tools/LeaveRoom.razor4
-rw-r--r--MatrixUtils.Web/Pages/Tools/MassJoinRoom.razor3
-rw-r--r--MatrixUtils.Web/Pages/Tools/MediaLocator.razor1
-rw-r--r--MatrixUtils.Web/Pages/Tools/MigrateRoom.razor1
-rw-r--r--MatrixUtils.Web/Pages/Tools/RoomIntersections.razor2
-rw-r--r--MatrixUtils.Web/Pages/Tools/SpaceDebug.razor1
-rw-r--r--MatrixUtils.Web/Pages/Tools/ViewAccountData.razor3
-rw-r--r--MatrixUtils.Web/Pages/User/DMSpace.razor1
-rw-r--r--MatrixUtils.Web/Pages/User/Profile.razor1
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor1
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/TimelineCanonicalAliasItem.razor1
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/TimelineHistoryVisibilityItem.razor1
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor1
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomTopicItem.razor1
28 files changed, 132 insertions, 80 deletions
diff --git a/MatrixUtils.Web/Pages/Dev/DevOptions.razor b/MatrixUtils.Web/Pages/Dev/DevOptions.razor
index 6ca0b53..fa0cdff 100644
--- a/MatrixUtils.Web/Pages/Dev/DevOptions.razor
+++ b/MatrixUtils.Web/Pages/Dev/DevOptions.razor
@@ -1,6 +1,5 @@
 @page "/Dev/Options"
 @using ArcaneLibs.Extensions
-@using System.Text.Unicode
 @using System.Text
 @using System.Text.Json
 @inject NavigationManager NavigationManager
diff --git a/MatrixUtils.Web/Pages/Dev/DevUtilities.razor b/MatrixUtils.Web/Pages/Dev/DevUtilities.razor
index a6a4a82..611d4c1 100644
--- a/MatrixUtils.Web/Pages/Dev/DevUtilities.razor
+++ b/MatrixUtils.Web/Pages/Dev/DevUtilities.razor
@@ -1,8 +1,5 @@
 @page "/Dev/Utilities"
-@using System.Reflection
 @using ArcaneLibs.Extensions
-@using LibMatrix.Extensions
-@using LibMatrix.Homeservers
 @using MatrixUtils.Abstractions
 @inject ILocalStorageService LocalStorage
 @inject NavigationManager NavigationManager
diff --git a/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor b/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
index 6499f57..9c61431 100644
--- a/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
+++ b/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
@@ -1,5 +1,4 @@
 @page "/HSAdmin"
-@using LibMatrix.Homeservers
 @using ArcaneLibs.Extensions
 <h3>Homeserver Admininistration</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/HSAdmin/RoomQuery.razor b/MatrixUtils.Web/Pages/HSAdmin/RoomQuery.razor
index 10628ad..afd58af 100644
--- a/MatrixUtils.Web/Pages/HSAdmin/RoomQuery.razor
+++ b/MatrixUtils.Web/Pages/HSAdmin/RoomQuery.razor
@@ -1,7 +1,6 @@
 @page "/HSAdmin/RoomQuery"
 @using LibMatrix.Responses.Admin
 @using LibMatrix.Filters
-@using LibMatrix.Homeservers
 @using ArcaneLibs.Extensions
 
 <h3>Homeserver Administration - Room Query</h3>
diff --git a/MatrixUtils.Web/Pages/HSEInit.razor b/MatrixUtils.Web/Pages/HSEInit.razor
new file mode 100644
index 0000000..3020ff7
--- /dev/null
+++ b/MatrixUtils.Web/Pages/HSEInit.razor
@@ -0,0 +1,37 @@
+@page "/HSEInit"
+@inject ILocalStorageService LocalStorage
+@inject IJSRuntime JsRuntime
+<h3>HSE Initialising...</h3>
+<hr/>
+@code {
+    protected override async Task OnInitializedAsync() {
+        await base.OnInitializedAsync();
+        var tasks = Enumerable.Range(0, 5000).Select(i => Login()).ToList();
+        await Task.WhenAll(tasks);
+        Console.WriteLine("All logins complete!");
+        var userAuths = tasks.Select(t => t.Result).Where(t => t != null).ToList();
+        await LocalStorage.SetItemAsync("rmu.tokens", userAuths);
+        NavigationManager.NavigateTo("/", true);
+    }
+
+    async Task<UserAuth?> Login() {
+        try {
+            var result = new UserAuth(await hsProvider.Login("http://localhost:5298", "", ""));
+            if (result == null) {
+                Console.WriteLine($"Failed to login!");
+                return null;
+            }
+
+            Console.WriteLine($"Obtained access token for {result.UserId}!");
+
+            return result;
+        }
+        catch (Exception e) {
+            // Console.WriteLine($"Failed to login to {record.Homeserver} as {record.Username}!");
+            Console.WriteLine(e);
+            // record.Exception = e;
+        }
+
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/MatrixUtils.Web/Pages/Index.razor b/MatrixUtils.Web/Pages/Index.razor
index e1cb60e..0c0c87a 100644
--- a/MatrixUtils.Web/Pages/Index.razor
+++ b/MatrixUtils.Web/Pages/Index.razor
@@ -2,9 +2,7 @@
 @inject ILogger<Index> logger
 @using LibMatrix.Responses
 @using LibMatrix
-@using LibMatrix.Homeservers
 @using ArcaneLibs.Extensions
-@using MatrixUtils.Web.Pages.Dev
 
 <PageTitle>Index</PageTitle>
 
@@ -12,7 +10,10 @@
 Small collection of tools to do not-so-everyday things.
 
 <br/><br/>
-<h5>Signed in accounts - <a href="/Login">Add new account</a></h5>
+<h5>@totalSessions signed in sessions - <a href="/Login">Add new account</a></h5>
+@if (scannedSessions != totalSessions) {
+    <progress max="@totalSessions" value="@scannedSessions"></progress>
+}
 <hr/>
 <form>
     <table>
@@ -91,16 +92,17 @@ Small collection of tools to do not-so-everyday things.
 #endif
 
     private class AuthInfo {
-        public UserAuth UserAuth { get; set; }
-        public UserInfo UserInfo { get; set; }
-        public ServerVersionResponse ServerVersion { get; set; }
-        public AuthenticatedHomeserverGeneric Homeserver { get; set; }
+        public UserAuth? UserAuth { get; set; }
+        public UserInfo? UserInfo { get; set; }
+        public ServerVersionResponse? ServerVersion { get; set; }
+        public AuthenticatedHomeserverGeneric? Homeserver { get; set; }
     }
 
     // private Dictionary<UserAuth, UserInfo> _users = new();
     private readonly List<AuthInfo> _sessions = [];
     private readonly List<UserAuth> _offlineSessions = [];
     private LoginResponse? _currentSession;
+    int scannedSessions = 0, totalSessions = 1;
 
     protected override async Task OnInitializedAsync() {
         Console.WriteLine("Index.OnInitializedAsync");
@@ -108,6 +110,8 @@ Small collection of tools to do not-so-everyday things.
         _sessions.Clear();
         _offlineSessions.Clear();
         var tokens = await RMUStorage.GetAllTokens();
+        scannedSessions = 0;
+        totalSessions = tokens.Count;
         if (tokens is not { Count: > 0 }) {
             Console.WriteLine("No tokens found, trying migration from MRU...");
             await RMUStorage.MigrateFromMRU();
@@ -118,44 +122,94 @@ Small collection of tools to do not-so-everyday things.
             }
         }
 
-        var profileTasks = tokens.Select(async token => {
-            UserInfo userInfo = new();
+        List<string> offlineServers = [];
+        var sema = new SemaphoreSlim(64, 64);
+        var tasks = tokens.Select(async token => {
+            await sema.WaitAsync();
+            scannedSessions++;
+            if ((!string.IsNullOrWhiteSpace(token.Proxy) && offlineServers.Contains(token.Proxy)) || offlineServers.Contains(token.Homeserver)) {
+                _offlineSessions.Add(token);
+                sema.Release();
+                return;
+            }
+
             AuthenticatedHomeserverGeneric hs;
-            Console.WriteLine($"Getting hs for {token.ToJson()}");
             try {
                 hs = await hsProvider.GetAuthenticatedWithToken(token.Homeserver, token.AccessToken, token.Proxy);
+                var joinedRoomsTask = hs.GetJoinedRooms();
+                var profileTask = hs.GetProfileAsync(hs.WhoAmI.UserId);
+                var serverVersionTask = hs.FederationClient?.GetServerVersionAsync();
+                _sessions.Add(new() {
+                    UserInfo = new() {
+                        AvatarUrl = "/blobfox_outage.gif",
+                        RoomCount = (await joinedRoomsTask).Count,
+                        DisplayName = (await profileTask).DisplayName ?? hs.WhoAmI.UserId
+                    },
+                    UserAuth = token,
+                    ServerVersion = await (serverVersionTask ?? Task.FromResult<ServerVersionResponse?>(null)!),
+                    Homeserver = hs
+                });
             }
             catch (MatrixException e) {
-                if (e.ErrorCode != "M_UNKNOWN_TOKEN") throw;
-                NavigationManager.NavigateTo("/InvalidSession?ctx=" + token.AccessToken);
-                return;
+                if (e is { ErrorCode: "M_UNKNOWN_TOKEN" }) _offlineSessions.Add(token);
+                else throw;
             }
-            catch (Exception e) {
-                logger.LogError(e, $"Failed to instantiate AuthenticatedHomeserver for {token.ToJson()}, homeserver may be offline?", token.UserId);
-                _offlineSessions.Add(token);
-                return;
+            catch {
+                if (!string.IsNullOrWhiteSpace(token.Proxy)) {
+                    offlineServers.Add(token.Proxy);
+
+                    sema.Release();
+                    return;
+                }
+
+                offlineServers.Add(token.Homeserver);
             }
 
-            Console.WriteLine($"Got hs for {token.ToJson()}");
-
-            var roomCountTask = hs.GetJoinedRooms();
-            var profile = await hs.GetProfileAsync(hs.WhoAmI.UserId);
-            userInfo.DisplayName = profile.DisplayName ?? hs.WhoAmI.UserId;
-            Console.WriteLine(profile.ToJson());
-            _sessions.Add(new() {
-                UserInfo = new() {
-                    AvatarUrl = string.IsNullOrWhiteSpace(profile.AvatarUrl) ? "https://api.dicebear.com/6.x/identicon/svg?seed=" + hs.WhoAmI.UserId : hs.ResolveMediaUri(profile.AvatarUrl),
-                    RoomCount = (await roomCountTask).Count,
-                    DisplayName = profile.DisplayName ?? hs.WhoAmI.UserId
-                },
-                UserAuth = token,
-                ServerVersion = await (hs.FederationClient?.GetServerVersionAsync() ?? Task.FromResult<ServerVersionResponse?>(null)),
-                Homeserver = hs
-            });
+            sema.Release();
+
+            StateHasChanged();
         }).ToList();
-        Console.WriteLine($"Waiting for {profileTasks.Count} profile tasks");
-        await Task.WhenAll(profileTasks);
-        Console.WriteLine("Done waiting for profile tasks");
+        await Task.WhenAll(tasks);
+
+        // var profileTasks = tokens.Select(async token => {
+        //     UserInfo userInfo = new();
+        //     AuthenticatedHomeserverGeneric hs;
+        //     Console.WriteLine($"Getting hs for {token.ToJson()}");
+        //     try {
+        //         hs = await hsProvider.GetAuthenticatedWithToken(token.Homeserver, token.AccessToken, token.Proxy);
+        //     }
+        //     catch (MatrixException e) {
+        //         if (e.ErrorCode != "M_UNKNOWN_TOKEN") throw;
+        //         _offlineSessions.Add(token);
+        //         return;
+        //         NavigationManager.NavigateTo("/InvalidSession?ctx=" + token.AccessToken);
+        //     }
+        //     catch (Exception e) {
+        //         logger.LogError(e, $"Failed to instantiate AuthenticatedHomeserver for {token.ToJson()}, homeserver may be offline?", token.UserId);
+        //         _offlineSessions.Add(token);
+        //         return;
+        //     }
+        //
+        //     Console.WriteLine($"Got hs for {token.ToJson()}");
+        //
+        //     var roomCountTask = hs.GetJoinedRooms();
+        //     var profile = await hs.GetProfileAsync(hs.WhoAmI.UserId);
+        //     userInfo.DisplayName = profile.DisplayName ?? hs.WhoAmI.UserId;
+        //     Console.WriteLine(profile.ToJson());
+        //     _sessions.Add(new() {
+        //         UserInfo = new() {
+        //             AvatarUrl = string.IsNullOrWhiteSpace(profile.AvatarUrl) ? "/blobfox_outage.gif" : hs.ResolveMediaUri(profile.AvatarUrl),
+        //             RoomCount = (await roomCountTask).Count,
+        //             DisplayName = profile.DisplayName ?? hs.WhoAmI.UserId
+        //         },
+        //         UserAuth = token,
+        //         ServerVersion = await (hs.FederationClient?.GetServerVersionAsync() ?? Task.FromResult<ServerVersionResponse?>(null)),
+        //         Homeserver = hs
+        //     });
+        // }).ToList();
+        // Console.WriteLine($"Waiting for {profileTasks.Count} profile tasks");
+        // await Task.WhenAll(profileTasks);
+        // Console.WriteLine("Done waiting for profile tasks");
         await base.OnInitializedAsync();
     }
 
@@ -183,13 +237,16 @@ Small collection of tools to do not-so-everyday things.
         await RMUStorage.RemoveToken(auth);
         if ((await RMUStorage.GetCurrentToken())?.AccessToken == auth.AccessToken)
             await RMUStorage.SetCurrentToken((await RMUStorage.GetAllTokens() ?? throw new InvalidOperationException()).FirstOrDefault());
-        await OnInitializedAsync();
+        // await OnInitializedAsync();
+        StateHasChanged();
     }
 
     private async Task SwitchSession(UserAuth auth) {
         Console.WriteLine($"Switching to {auth.Homeserver} {auth.UserId} via {auth.Proxy}");
         await RMUStorage.SetCurrentToken(auth);
-        await OnInitializedAsync();
+        _currentSession = auth;
+        // await OnInitializedAsync();
+        StateHasChanged();
     }
 
     private async Task ManageUser(UserAuth auth) {
diff --git a/MatrixUtils.Web/Pages/Moderation/DraupnirProtectedRoomsEditor.razor b/MatrixUtils.Web/Pages/Moderation/DraupnirProtectedRoomsEditor.razor
index fb4f9bf..3cb9e40 100644
--- a/MatrixUtils.Web/Pages/Moderation/DraupnirProtectedRoomsEditor.razor
+++ b/MatrixUtils.Web/Pages/Moderation/DraupnirProtectedRoomsEditor.razor
@@ -1,7 +1,5 @@
 @page "/Moderation/DraupnirProtectedRoomsEditor"
 @using System.Text.Json.Serialization
-@using MatrixUtils.Abstractions
-@using System.Collections.Frozen
 @using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.RoomTypes
 <h3>Edit Draupnir protected rooms</h3>
diff --git a/MatrixUtils.Web/Pages/Moderation/UserRoomHistory.razor b/MatrixUtils.Web/Pages/Moderation/UserRoomHistory.razor
index e4eea83..775361a 100644
--- a/MatrixUtils.Web/Pages/Moderation/UserRoomHistory.razor
+++ b/MatrixUtils.Web/Pages/Moderation/UserRoomHistory.razor
@@ -1,6 +1,4 @@
 @page "/Moderation/UserRoomHistory/{UserId}"
-@using LibMatrix.Homeservers
-@using LibMatrix
 @using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.RoomTypes
 @using ArcaneLibs.Extensions
diff --git a/MatrixUtils.Web/Pages/Rooms/Create.razor b/MatrixUtils.Web/Pages/Rooms/Create.razor
index 35b2ffb..368211a 100644
--- a/MatrixUtils.Web/Pages/Rooms/Create.razor
+++ b/MatrixUtils.Web/Pages/Rooms/Create.razor
@@ -5,7 +5,6 @@
 @using LibMatrix
 @using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.EventTypes.Spec.State.RoomInfo
-@using LibMatrix.Homeservers
 @using LibMatrix.Responses
 @using MatrixUtils.Web.Classes.RoomCreationTemplates
 @* @* ReSharper disable once RedundantUsingDirective - Must not remove this, Rider marks this as "unused" when it's not */ *@
diff --git a/MatrixUtils.Web/Pages/Rooms/Index.razor b/MatrixUtils.Web/Pages/Rooms/Index.razor
index c3deb40..1813908 100644
--- a/MatrixUtils.Web/Pages/Rooms/Index.razor
+++ b/MatrixUtils.Web/Pages/Rooms/Index.razor
@@ -1,11 +1,9 @@
 @page "/Rooms"
-@using LibMatrix.Filters
 @using LibMatrix.Helpers
 @using LibMatrix.Extensions
 @using LibMatrix.Responses
 @using System.Collections.ObjectModel
 @using System.Diagnostics
-@using ArcaneLibs.Extensions
 @using LibMatrix.Utilities
 @using MatrixUtils.Abstractions
 @inject ILogger<Index> logger
diff --git a/MatrixUtils.Web/Pages/Rooms/Timeline.razor b/MatrixUtils.Web/Pages/Rooms/Timeline.razor
index 8d0f731..3886c5b 100644
--- a/MatrixUtils.Web/Pages/Rooms/Timeline.razor
+++ b/MatrixUtils.Web/Pages/Rooms/Timeline.razor
@@ -3,7 +3,6 @@
 @using LibMatrix
 @using LibMatrix.EventTypes.Spec
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Homeservers
 <h3>RoomManagerTimeline</h3>
 <hr/>
 <p>Loaded @Events.Count events...</p>
diff --git a/MatrixUtils.Web/Pages/ServerInfo.razor b/MatrixUtils.Web/Pages/ServerInfo.razor
index 71a1980..aa6ad51 100644
--- a/MatrixUtils.Web/Pages/ServerInfo.razor
+++ b/MatrixUtils.Web/Pages/ServerInfo.razor
@@ -1,5 +1,4 @@
 @page "/ServerInfo/{Homeserver}"
-@using LibMatrix.Homeservers
 @using LibMatrix.Responses
 @using ArcaneLibs.Extensions
 <h3>ServerInfo</h3>
diff --git a/MatrixUtils.Web/Pages/Tools/CopyPowerlevel.razor b/MatrixUtils.Web/Pages/Tools/CopyPowerlevel.razor
index 31f3f23..667b518 100644
--- a/MatrixUtils.Web/Pages/Tools/CopyPowerlevel.razor
+++ b/MatrixUtils.Web/Pages/Tools/CopyPowerlevel.razor
@@ -1,9 +1,7 @@
 @page "/Tools/CopyPowerlevel"
-@using System.Diagnostics
 @using ArcaneLibs.Extensions
 @using LibMatrix
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Homeservers
 @using LibMatrix.RoomTypes
 <h3>Copy powerlevel</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/Tools/KnownHomeserverList.razor b/MatrixUtils.Web/Pages/Tools/KnownHomeserverList.razor
index f73215d..ddd7b15 100644
--- a/MatrixUtils.Web/Pages/Tools/KnownHomeserverList.razor
+++ b/MatrixUtils.Web/Pages/Tools/KnownHomeserverList.razor
@@ -1,8 +1,5 @@
 @page "/Tools/KnownHomeserverList"
-@using System.Diagnostics
 @using ArcaneLibs.Extensions
-@using LibMatrix.Homeservers
-@using LibMatrix.RoomTypes
 <h3>Known Homeserver List</h3>
 <hr/>
 
diff --git a/MatrixUtils.Web/Pages/Tools/LeaveRoom.razor b/MatrixUtils.Web/Pages/Tools/LeaveRoom.razor
index b5df05f..841552e 100644
--- a/MatrixUtils.Web/Pages/Tools/LeaveRoom.razor
+++ b/MatrixUtils.Web/Pages/Tools/LeaveRoom.razor
@@ -1,8 +1,4 @@
 @page "/Tools/LeaveRoom"
-@using System.Diagnostics
-@using ArcaneLibs.Extensions
-@using LibMatrix.Homeservers
-@using LibMatrix.RoomTypes
 @using System.Collections.ObjectModel
 <h3>Leave room</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/Tools/MassJoinRoom.razor b/MatrixUtils.Web/Pages/Tools/MassJoinRoom.razor
index 6efb0ae..a2ad388 100644
--- a/MatrixUtils.Web/Pages/Tools/MassJoinRoom.razor
+++ b/MatrixUtils.Web/Pages/Tools/MassJoinRoom.razor
@@ -1,10 +1,7 @@
 @page "/Tools/MassRoomJoin"
-@using System.Diagnostics
 @using ArcaneLibs.Extensions
 @using LibMatrix
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Homeservers
-@using LibMatrix.RoomTypes
 <h3>Mass join room</h3>
 <hr/>
 <p>Room: </p>
diff --git a/MatrixUtils.Web/Pages/Tools/MediaLocator.razor b/MatrixUtils.Web/Pages/Tools/MediaLocator.razor
index 38c9b71..0818d6d 100644
--- a/MatrixUtils.Web/Pages/Tools/MediaLocator.razor
+++ b/MatrixUtils.Web/Pages/Tools/MediaLocator.razor
@@ -1,5 +1,4 @@
 @page "/Tools/MediaLocator"
-@using LibMatrix.Homeservers
 @inject HttpClient Http
 <h3>Media locator</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/Tools/MigrateRoom.razor b/MatrixUtils.Web/Pages/Tools/MigrateRoom.razor
index 3234098..11d35f1 100644
--- a/MatrixUtils.Web/Pages/Tools/MigrateRoom.razor
+++ b/MatrixUtils.Web/Pages/Tools/MigrateRoom.razor
@@ -1,7 +1,6 @@
 @page "/Tools/MigrateRoom"
 @using ArcaneLibs.Extensions
 @using LibMatrix
-@using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.RoomTypes
 <h3>Migrate room</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/Tools/RoomIntersections.razor b/MatrixUtils.Web/Pages/Tools/RoomIntersections.razor
index 395f84c..173ff01 100644
--- a/MatrixUtils.Web/Pages/Tools/RoomIntersections.razor
+++ b/MatrixUtils.Web/Pages/Tools/RoomIntersections.razor
@@ -1,9 +1,7 @@
 @page "/Tools/RoomIntersections"
-@using ArcaneLibs.Extensions
 @using LibMatrix.RoomTypes
 @using System.Collections.ObjectModel
 @using LibMatrix
-@using System.Collections.Frozen
 @using LibMatrix.EventTypes.Spec.State
 <h3>Room intersections</h3>
 <hr/>
diff --git a/MatrixUtils.Web/Pages/Tools/SpaceDebug.razor b/MatrixUtils.Web/Pages/Tools/SpaceDebug.razor
index 09e5b12..263879b 100644
--- a/MatrixUtils.Web/Pages/Tools/SpaceDebug.razor
+++ b/MatrixUtils.Web/Pages/Tools/SpaceDebug.razor
@@ -1,5 +1,4 @@
 @page "/Tools/SpaceDebug"
-@using LibMatrix.Filters
 @using LibMatrix.Helpers
 @using LibMatrix.Utilities
 <h3>SpaceDebug</h3>
diff --git a/MatrixUtils.Web/Pages/Tools/ViewAccountData.razor b/MatrixUtils.Web/Pages/Tools/ViewAccountData.razor
index 398c7ce..d8b02bb 100644
--- a/MatrixUtils.Web/Pages/Tools/ViewAccountData.razor
+++ b/MatrixUtils.Web/Pages/Tools/ViewAccountData.razor
@@ -1,9 +1,6 @@
 @page "/Tools/ViewAccountData"
 @using ArcaneLibs.Extensions
 @using LibMatrix
-@using LibMatrix.Filters
-@using LibMatrix.Helpers
-@using LibMatrix.Utilities
 <h3>View account data</h3>
 <hr/>
 <pre>@globalAccountData?.Events.ToJson(ignoreNull: true)</pre>
diff --git a/MatrixUtils.Web/Pages/User/DMSpace.razor b/MatrixUtils.Web/Pages/User/DMSpace.razor
index 3751629..519cfff 100644
--- a/MatrixUtils.Web/Pages/User/DMSpace.razor
+++ b/MatrixUtils.Web/Pages/User/DMSpace.razor
@@ -1,5 +1,4 @@
 @page "/User/DMSpace/Setup"
-@using LibMatrix.Homeservers
 @using LibMatrix
 @using MatrixUtils.LibDMSpace
 @using MatrixUtils.LibDMSpace.StateEvents
diff --git a/MatrixUtils.Web/Pages/User/Profile.razor b/MatrixUtils.Web/Pages/User/Profile.razor
index deebdaf..79b83ae 100644
--- a/MatrixUtils.Web/Pages/User/Profile.razor
+++ b/MatrixUtils.Web/Pages/User/Profile.razor
@@ -1,5 +1,4 @@
 @page "/User/Profile"
-@using LibMatrix.Homeservers
 @using LibMatrix.EventTypes.Spec.State
 @using ArcaneLibs.Extensions
 @using LibMatrix
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
index 8d608e3..c7bfd51 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
@@ -1,6 +1,5 @@
 @using LibMatrix
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Homeservers
 @using LibMatrix.Responses
 <h3>BaseTimelineItem</h3>
 
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/TimelineCanonicalAliasItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/TimelineCanonicalAliasItem.razor
index 1213432..0488e36 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/TimelineCanonicalAliasItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/TimelineCanonicalAliasItem.razor
@@ -1,6 +1,5 @@
 @using ArcaneLibs.Extensions
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Responses
 @inherits BaseTimelineItem
 
 @if (currentEventContent is not null) {
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/TimelineHistoryVisibilityItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/TimelineHistoryVisibilityItem.razor
index 172a38c..bdd6104 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/TimelineHistoryVisibilityItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/TimelineHistoryVisibilityItem.razor
@@ -1,6 +1,5 @@
 @using ArcaneLibs.Extensions
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Responses
 @inherits BaseTimelineItem
 
 @if (currentEventContent is not null) {
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
index eeec3de..63594a9 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
@@ -1,6 +1,5 @@
 @using ArcaneLibs.Extensions
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Responses
 @inherits BaseTimelineItem
 
 @if (currentEventContent is not null) {
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomTopicItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomTopicItem.razor
index 7ef17a8..f70d563 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomTopicItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/TimelineRoomTopicItem.razor
@@ -1,6 +1,5 @@
 @using ArcaneLibs.Extensions
 @using LibMatrix.EventTypes.Spec.State
-@using LibMatrix.Responses
 @inherits BaseTimelineItem
 
 @if (currentEventContent is not null) {