From f866946fbbe962c712049327ade9dcbd43900295 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 25 Jun 2023 03:07:05 +0200 Subject: Working state, refactored Rory&::LibMatrix --- MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs | 2 +- .../DefaultRoomCreationTemplate.cs | 5 +-- MatrixRoomUtils.Web/Pages/DebugTools.razor | 1 - MatrixRoomUtils.Web/Pages/DevOptions.razor | 1 - MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor | 1 - .../Pages/KnownHomeserverList.razor | 1 - MatrixRoomUtils.Web/Pages/LoginPage.razor | 2 +- MatrixRoomUtils.Web/Pages/MediaLocator.razor | 2 +- .../Pages/PolicyList/PolicyListEditorPage.razor | 3 +- .../Pages/PolicyList/PolicyListRoomList.razor | 1 - .../Pages/RoomManager/RoomManagerCreateRoom.razor | 38 ++++++++-------------- .../Pages/RoomManager/RoomManagerSpace.razor | 1 - .../Pages/RoomState/RoomStateEditorPage.razor | 2 +- .../Pages/RoomState/RoomStateViewerPage.razor | 3 +- .../Shared/IndexComponents/IndexUserItem.razor | 7 ++-- MatrixRoomUtils.Web/Shared/InlineUserItem.razor | 4 +-- .../Shared/SimpleComponents/DictionaryEditor.razor | 1 - .../TimelineComponents/TimelineMemberItem.razor | 13 ++++---- .../TimelineComponents/TimelineMessageItem.razor | 1 - .../TimelineComponents/TimelineUnknownItem.razor | 1 - MatrixRoomUtils.Web/Shared/UserListItem.razor | 6 ++-- MatrixRoomUtils.Web/wwwroot/css/app.css | 2 +- 22 files changed, 37 insertions(+), 61 deletions(-) (limited to 'MatrixRoomUtils.Web') diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs index 878eca4..59ec4db 100644 --- a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs +++ b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs @@ -21,7 +21,7 @@ public class LocalStorageWrapper { Console.WriteLine("Access token is not null, creating authenticated home server"); Console.WriteLine($"Homeserver cache: {RuntimeCache.HomeserverResolutionCache.Count} entries"); // Console.WriteLine(RuntimeCache.HomeserverResolutionCache.ToJson()); - RuntimeCache.CurrentHomeServer = await new AuthenticatedHomeServer(RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.HomeServer, RuntimeCache.LastUsedToken, TODO).Configure(); + RuntimeCache.CurrentHomeServer = await new AuthenticatedHomeServer(RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.HomeServer, RuntimeCache.LastUsedToken, null).Configure(); Console.WriteLine("Created authenticated home server"); } } diff --git a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs index 77c8281..47844e3 100644 --- a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs +++ b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs @@ -1,6 +1,7 @@ using System.Text.Json.Nodes; using MatrixRoomUtils.Core; using MatrixRoomUtils.Core.Responses; +using MatrixRoomUtils.Core.StateEventTypes; namespace MatrixRoomUtils.Web.Classes.RoomCreationTemplates; @@ -18,9 +19,9 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { history_visibility = "world_readable" } }, - new StateEvent { + new StateEvent { Type = "m.room.guest_access", - Content = new Pages.RoomManager.RoomManagerCreateRoom.GuestAccessContent { + Content = new GuestAccessData { GuestAccess = "can_join" } }, diff --git a/MatrixRoomUtils.Web/Pages/DebugTools.razor b/MatrixRoomUtils.Web/Pages/DebugTools.razor index da5c172..4e4cec8 100644 --- a/MatrixRoomUtils.Web/Pages/DebugTools.razor +++ b/MatrixRoomUtils.Web/Pages/DebugTools.razor @@ -1,6 +1,5 @@ @page "/Debug" @using System.Reflection -@using MatrixRoomUtils.Core.Extensions @using MatrixRoomUtils.Core.Interfaces @inject ILocalStorageService LocalStorage @inject NavigationManager NavigationManager diff --git a/MatrixRoomUtils.Web/Pages/DevOptions.razor b/MatrixRoomUtils.Web/Pages/DevOptions.razor index 0843d5f..cdb5693 100644 --- a/MatrixRoomUtils.Web/Pages/DevOptions.razor +++ b/MatrixRoomUtils.Web/Pages/DevOptions.razor @@ -1,5 +1,4 @@ @page "/DevOptions" -@using MatrixRoomUtils.Core.Extensions @inject NavigationManager NavigationManager @inject ILocalStorageService LocalStorage diff --git a/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor b/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor index 1fe13bd..858fad9 100644 --- a/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor +++ b/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor @@ -1,5 +1,4 @@ @page "/HSAdmin/RoomQuery" -@using MatrixRoomUtils.Core.Extensions @using MatrixRoomUtils.Core.Filters @using MatrixRoomUtils.Core.Responses.Admin @using MatrixRoomUtils.Web.Shared.SimpleComponents diff --git a/MatrixRoomUtils.Web/Pages/KnownHomeserverList.razor b/MatrixRoomUtils.Web/Pages/KnownHomeserverList.razor index 8031146..80dbfd1 100644 --- a/MatrixRoomUtils.Web/Pages/KnownHomeserverList.razor +++ b/MatrixRoomUtils.Web/Pages/KnownHomeserverList.razor @@ -1,6 +1,5 @@ @page "/KnownHomeserverList" @using System.Text.Json -@using MatrixRoomUtils.Core.Extensions @using System.Diagnostics @using MatrixRoomUtils.Core.Responses

Known Homeserver List

diff --git a/MatrixRoomUtils.Web/Pages/LoginPage.razor b/MatrixRoomUtils.Web/Pages/LoginPage.razor index 3b78817..9df7fa6 100644 --- a/MatrixRoomUtils.Web/Pages/LoginPage.razor +++ b/MatrixRoomUtils.Web/Pages/LoginPage.razor @@ -52,7 +52,7 @@ var userinfo = new UserInfo { LoginResponse = result }; - userinfo.Profile = await (await new AuthenticatedHomeServer(result.HomeServer, result.AccessToken, TODO).Configure()).GetProfile(result.UserId); + userinfo.Profile = await RuntimeCache.CurrentHomeServer.GetProfile(result.UserId); RuntimeCache.LastUsedToken = result.AccessToken; RuntimeCache.LoginSessions.Add(result.AccessToken, userinfo); diff --git a/MatrixRoomUtils.Web/Pages/MediaLocator.razor b/MatrixRoomUtils.Web/Pages/MediaLocator.razor index 36cd8e6..38d1514 100644 --- a/MatrixRoomUtils.Web/Pages/MediaLocator.razor +++ b/MatrixRoomUtils.Web/Pages/MediaLocator.razor @@ -61,7 +61,7 @@ await sem.WaitAsync(); var httpClient = new HttpClient { BaseAddress = new Uri(hs) }; httpClient.Timeout = TimeSpan.FromSeconds(5); - var rmu = mxcUrl.Replace("mxc://", $"{hs}/_matrix/media/r0/download/"); + var rmu = mxcUrl.Replace("mxc://", $"{hs}/_matrix/media/v3/download/"); try { var res = await httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Head, rmu)); if (res.IsSuccessStatusCode) { diff --git a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListEditorPage.razor b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListEditorPage.razor index 76b4384..0840ebf 100644 --- a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListEditorPage.razor +++ b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListEditorPage.razor @@ -1,5 +1,4 @@ @page "/PolicyListEditor/{RoomId}" -@using MatrixRoomUtils.Core.Extensions @using MatrixRoomUtils.Core.StateEventTypes @using System.Text.Json @using MatrixRoomUtils.Core.Responses @@ -210,7 +209,7 @@ else { private async Task LoadStatesAsync() { // using var client = new HttpClient(); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalStorageWrapper.AccessToken); - // var response = await client.GetAsync($"{LocalStorageWrapper.CurrentHomeserver}/_matrix/client/r0/rooms/{RoomId}/state"); + // var response = await client.GetAsync($"{LocalStorageWrapper.CurrentHomeserver}/_matrix/client/v3/rooms/{RoomId}/state"); // var Content = await response.Content.ReadAsStringAsync(); // Console.WriteLine(JsonSerializer.Deserialize(Content).ToJson()); // var stateEvents = JsonSerializer.Deserialize>(Content); diff --git a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor index 20eab7a..8f711b5 100644 --- a/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor +++ b/MatrixRoomUtils.Web/Pages/PolicyList/PolicyListRoomList.razor @@ -1,5 +1,4 @@ @page "/PolicyListEditor" -@using MatrixRoomUtils.Core.Extensions @inject ILocalStorageService LocalStorage @inject NavigationManager NavigationManager

Policy list editor - Room list

diff --git a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerCreateRoom.razor b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerCreateRoom.razor index 5cfda77..80d852a 100644 --- a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerCreateRoom.razor +++ b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerCreateRoom.razor @@ -1,9 +1,8 @@ @page "/RoomManagerCreateRoom" -@using MatrixRoomUtils.Core.Extensions @using MatrixRoomUtils.Core.Responses @using System.Text.Json -@using System.Text.Json.Serialization @using System.Reflection +@using MatrixRoomUtils.Core.StateEventTypes @using MatrixRoomUtils.Web.Classes.RoomCreationTemplates @* ReSharper disable once RedundantUsingDirective - Must not remove this, Rider marks this as "unused" when it's not *@ @using MatrixRoomUtils.Web.Shared.SimpleComponents @@ -53,12 +52,12 @@ History visibility: - - - - - - + @* *@ + @* *@ + @* *@ + @* *@ + @* *@ + @* *@ @@ -220,15 +219,15 @@ OverwriteWrappedPropertiesFromEvent(); creationEvent.PowerLevelContentOverride.Events = creationEvent.PowerLevelContentOverride.Events.OrderByDescending(x => x.Value).ThenBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value); creationEvent.PowerLevelContentOverride.Users = creationEvent.PowerLevelContentOverride.Users.OrderByDescending(x => x.Value).ThenBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value); - guestAccessEvent = creationEvent["m.room.guest_access"].As().Content; + guestAccessEvent = creationEvent["m.room.guest_access"].As().Content; Console.WriteLine($"Creation event uncasted: {creationEvent["m.room.guest_access"].ToJson()}"); - Console.WriteLine($"Creation event casted: {creationEvent["m.room.guest_access"].As().ToJson()}"); - creationEvent["m.room.guest_access"].As().Content.IsGuestAccessEnabled = true; + Console.WriteLine($"Creation event casted: {creationEvent["m.room.guest_access"].As().ToJson()}"); + creationEvent["m.room.guest_access"].As().Content.IsGuestAccessEnabled = true; Console.WriteLine("-- Created new guest access content --"); Console.WriteLine($"Creation event uncasted: {creationEvent["m.room.guest_access"].ToJson()}"); - Console.WriteLine($"Creation event casted: {creationEvent["m.room.guest_access"].As().ToJson()}"); - Console.WriteLine($"Creation event casted back: {creationEvent["m.room.guest_access"].As().ToJson()}"); + Console.WriteLine($"Creation event casted: {creationEvent["m.room.guest_access"].As().ToJson()}"); + Console.WriteLine($"Creation event casted back: {creationEvent["m.room.guest_access"].As().ToJson()}"); StateHasChanged(); } } @@ -236,7 +235,7 @@ private Dictionary creationEventValidationErrors { get; set; } = new(); private CreateRoomRequest creationEvent { get; set; } - GuestAccessContent guestAccessEvent { get; set; } + GuestAccessData guestAccessEvent { get; set; } private Dictionary Presets { get; set; } = new(); @@ -275,7 +274,7 @@ Console.WriteLine("Overwriting wrapped properties"); Console.WriteLine($"Allow: {ServerACLAllowRules.Count}: {string.Join(", ", ServerACLAllowRules)}"); Console.WriteLine($"Deny: {ServerACLDenyRules.Count}: {string.Join(", ", ServerACLDenyRules)}"); - creationEvent.ServerACLs = new ServerACL { + creationEvent.ServerACLs = new ServerACLData { Allow = ServerACLAllowRules, Deny = ServerACLDenyRules, AllowIpLiterals = creationEvent.ServerACLs.AllowIpLiterals @@ -336,14 +335,5 @@ _ => key }; - public class GuestAccessContent { - [JsonPropertyName("guest_access")] - public string GuestAccess { get; set; } - - public bool IsGuestAccessEnabled { - get => GuestAccess == "can_join"; - set => GuestAccess = value ? "can_join" : "forbidden"; - } - } } diff --git a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerSpace.razor b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerSpace.razor index ab650d1..a9c71c4 100644 --- a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerSpace.razor +++ b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerSpace.razor @@ -1,5 +1,4 @@ @page "/RoomManager/Space/{RoomId}" -@using MatrixRoomUtils.Core.Extensions @using System.Text.Json @using MatrixRoomUtils.Core.Responses

Room manager - Viewing Space

diff --git a/MatrixRoomUtils.Web/Pages/RoomState/RoomStateEditorPage.razor b/MatrixRoomUtils.Web/Pages/RoomState/RoomStateEditorPage.razor index fa5b6a8..296514c 100644 --- a/MatrixRoomUtils.Web/Pages/RoomState/RoomStateEditorPage.razor +++ b/MatrixRoomUtils.Web/Pages/RoomState/RoomStateEditorPage.razor @@ -63,7 +63,7 @@ using var client = new HttpClient(); //TODO: can this be improved? client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", RuntimeCache.CurrentHomeServer.AccessToken); - var response = await client.GetAsync($"{RuntimeCache.CurrentHomeServer.FullHomeServerDomain}/_matrix/client/r0/rooms/{RoomId}/state"); + var response = await client.GetAsync($"{RuntimeCache.CurrentHomeServer.FullHomeServerDomain}/_matrix/client/v3/rooms/{RoomId}/state"); // var response = await client.GetAsync($"http://localhost:5117/matrix-hq-state.json"); //var _events = await response.Content.ReadFromJsonAsync>(); var _data = await response.Content.ReadAsStreamAsync(); diff --git a/MatrixRoomUtils.Web/Pages/RoomState/RoomStateViewerPage.razor b/MatrixRoomUtils.Web/Pages/RoomState/RoomStateViewerPage.razor index bfd4d10..ff1d9ac 100644 --- a/MatrixRoomUtils.Web/Pages/RoomState/RoomStateViewerPage.razor +++ b/MatrixRoomUtils.Web/Pages/RoomState/RoomStateViewerPage.razor @@ -1,5 +1,4 @@ @page "/RoomStateViewer/{RoomId}" -@using MatrixRoomUtils.Core.Extensions @using System.Net.Http.Headers @using System.Text.Json @inject ILocalStorageService LocalStorage @@ -88,7 +87,7 @@ //TODO: can we improve this? using var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", RuntimeCache.CurrentHomeServer.AccessToken); - var response = await client.GetAsync($"{RuntimeCache.CurrentHomeServer.FullHomeServerDomain}/_matrix/client/r0/rooms/{RoomId}/state"); + var response = await client.GetAsync($"{RuntimeCache.CurrentHomeServer.FullHomeServerDomain}/_matrix/client/v3/rooms/{RoomId}/state"); // var response = await client.GetAsync($"http://localhost:5117/matrix-hq-state.json"); //var _events = await response.Content.ReadFromJsonAsync>(); var _data = await response.Content.ReadAsStreamAsync(); diff --git a/MatrixRoomUtils.Web/Shared/IndexComponents/IndexUserItem.razor b/MatrixRoomUtils.Web/Shared/IndexComponents/IndexUserItem.razor index 8ab44fb..975da43 100644 --- a/MatrixRoomUtils.Web/Shared/IndexComponents/IndexUserItem.razor +++ b/MatrixRoomUtils.Web/Shared/IndexComponents/IndexUserItem.razor @@ -22,12 +22,13 @@ private int _roomCount { get; set; } = 0; protected override async Task OnInitializedAsync() { - var hs = await new AuthenticatedHomeServer(User.LoginResponse.HomeServer, User.AccessToken, TODO).Configure(); + await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); + if (User.Profile.AvatarUrl != null && User.Profile.AvatarUrl != "") - _avatarUrl = hs.ResolveMediaUri(User.Profile.AvatarUrl); + _avatarUrl = RuntimeCache.CurrentHomeServer.ResolveMediaUri(User.Profile.AvatarUrl); else _avatarUrl = "https://api.dicebear.com/6.x/identicon/svg?seed=" + User.LoginResponse.UserId; try { - _roomCount = (await hs.GetJoinedRooms()).Count; + _roomCount = (await RuntimeCache.CurrentHomeServer.GetJoinedRooms()).Count; } catch { _roomCount = -1; diff --git a/MatrixRoomUtils.Web/Shared/InlineUserItem.razor b/MatrixRoomUtils.Web/Shared/InlineUserItem.razor index 43a4111..0a58b4d 100644 --- a/MatrixRoomUtils.Web/Shared/InlineUserItem.razor +++ b/MatrixRoomUtils.Web/Shared/InlineUserItem.razor @@ -36,13 +36,11 @@ await _semaphoreSlim.WaitAsync(); - var hs = await new AuthenticatedHomeServer(RuntimeCache.CurrentHomeServer.HomeServerDomain, RuntimeCache.CurrentHomeServer.AccessToken, TODO).Configure(); - if (User == null) { if (UserId == null) { throw new ArgumentNullException(nameof(UserId)); } - User = await hs.GetProfile(UserId); + User = await RuntimeCache.CurrentHomeServer.GetProfile(UserId); } // UserId = User.; diff --git a/MatrixRoomUtils.Web/Shared/SimpleComponents/DictionaryEditor.razor b/MatrixRoomUtils.Web/Shared/SimpleComponents/DictionaryEditor.razor index 42a5f64..ea7d2ec 100644 --- a/MatrixRoomUtils.Web/Shared/SimpleComponents/DictionaryEditor.razor +++ b/MatrixRoomUtils.Web/Shared/SimpleComponents/DictionaryEditor.razor @@ -1,4 +1,3 @@ -@using MatrixRoomUtils.Core.Extensions @foreach (var i in Items.Keys) { var key = i; diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor index 4fb5596..f89dc44 100644 --- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor @@ -1,22 +1,21 @@ -@using MatrixRoomUtils.Core.Extensions -@if (Event.ContentAsJsonNode["membership"]!.GetValue() == "ban") { +@if (Event.membership"]!.GetValue() == "ban") { @Event.StateKey was banned } -else if (Event.ContentAsJsonNode["membership"]!.GetValue() == "invite") { +else if (Event.membership"]!.GetValue() == "invite") { @Event.StateKey was invited } -else if (Event.ContentAsJsonNode["membership"]!.GetValue() == "join") { +else if (Event.membership"]!.GetValue() == "join") { @if (Event.ReplacesState != null) { - @Event.StateKey changed their display name to @(Event.ContentAsJsonNode["displayname"]!.GetValue()) + @Event.StateKey changed their display name to @(Event.displayname"]!.GetValue()) } else { joined } } -else if (Event.ContentAsJsonNode["membership"]!.GetValue() == "leave") { +else if (Event.membership"]!.GetValue() == "leave") { @Event.StateKey left } -else if (Event.ContentAsJsonNode["membership"]!.GetValue() == "knock") { +else if (Event.membership"]!.GetValue() == "knock") { @Event.StateKey knocked } else { diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor index 80a432b..6c26dc2 100644 --- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor @@ -1,4 +1,3 @@ -@using MatrixRoomUtils.Core.Extensions @using MatrixRoomUtils.Core.Responses
     @ObjectExtensions.ToJson(Event.Content, indent: false)
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineUnknownItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineUnknownItem.razor
index f78bdc9..d8ea7e2 100644
--- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineUnknownItem.razor
+++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineUnknownItem.razor
@@ -1,4 +1,3 @@
-@using MatrixRoomUtils.Core.Extensions
 
diff --git a/MatrixRoomUtils.Web/Shared/UserListItem.razor b/MatrixRoomUtils.Web/Shared/UserListItem.razor index b99671a..52f398a 100644 --- a/MatrixRoomUtils.Web/Shared/UserListItem.razor +++ b/MatrixRoomUtils.Web/Shared/UserListItem.razor @@ -25,7 +25,7 @@ private string? profileAvatar { get; set; } = "/icon-192.png"; private string? profileName { get; set; } = "Loading..."; - private static SemaphoreSlim _semaphoreSlim = new(128); + private static SemaphoreSlim _semaphoreSlim = new(8); protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); @@ -33,13 +33,11 @@ await _semaphoreSlim.WaitAsync(); - var hs = await new AuthenticatedHomeServer(RuntimeCache.CurrentHomeServer.HomeServerDomain, RuntimeCache.CurrentHomeServer.AccessToken, TODO).Configure(); - if (User == null) { if (UserId == null) { throw new ArgumentNullException(nameof(UserId)); } - User = await hs.GetProfile(UserId); + User = await RuntimeCache.CurrentHomeServer.GetProfile(UserId); } // UserId = User.; diff --git a/MatrixRoomUtils.Web/wwwroot/css/app.css b/MatrixRoomUtils.Web/wwwroot/css/app.css index cb7ba63..b3a8cf3 100644 --- a/MatrixRoomUtils.Web/wwwroot/css/app.css +++ b/MatrixRoomUtils.Web/wwwroot/css/app.css @@ -74,7 +74,7 @@ a, .btn-link { } .blazor-error-boundary { - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3O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