From 89a14526658e5d061b1aef34ab569e979c9c0cf8 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 6 Aug 2025 03:15:16 +0200 Subject: Various changes, room create/upgrade work --- MatrixUtils.Web/Pages/Dev/DevUtilities.razor | 31 +++++++++++++++++++++++++++- MatrixUtils.Web/Pages/Dev/WellKnownRes.razor | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'MatrixUtils.Web/Pages/Dev') diff --git a/MatrixUtils.Web/Pages/Dev/DevUtilities.razor b/MatrixUtils.Web/Pages/Dev/DevUtilities.razor index 3b2d533..f6392a4 100644 --- a/MatrixUtils.Web/Pages/Dev/DevUtilities.razor +++ b/MatrixUtils.Web/Pages/Dev/DevUtilities.razor @@ -1,5 +1,8 @@ @page "/Dev/Utilities" @using ArcaneLibs.Extensions +@using LibMatrix.EventTypes.Spec.Ephemeral +@using LibMatrix.EventTypes.Spec.State.RoomInfo +@using LibMatrix.Helpers @using MatrixUtils.Abstractions

Debug Tools

@@ -14,7 +17,7 @@ else { Room List @foreach (var roomId in Rooms) { - + } @@ -61,6 +64,7 @@ else { StateHasChanged(); return; } + if (res.Content.Headers.ContentType.MediaType == "application/json") GetRequestResult = $"Error: {res.StatusCode}\n" + (await res.Content.ReadFromJsonAsync()).ToJson(); else @@ -69,7 +73,32 @@ else { catch (Exception e) { GetRequestResult = $"Error: {e}"; } + StateHasChanged(); } + private async Task TestRoomBuilder() { + var rb = new RoomBuilder() { + HistoryVisibility = new RoomHistoryVisibilityEventContent() { HistoryVisibility = RoomHistoryVisibilityEventContent.HistoryVisibilityTypes.Shared }, + ImportantState = [ + new() { + RawContent = new() { + ["type"] = "m.room.name", + ["name"] = "Test Room" + } + }, + new() { + Type = "test", + TypedContent = new PresenceEventContent() { + Presence = "online", + LastActiveAgo = 0, + } + }, + + ] + }; + + await rb.Create(hs); + } + } \ No newline at end of file diff --git a/MatrixUtils.Web/Pages/Dev/WellKnownRes.razor b/MatrixUtils.Web/Pages/Dev/WellKnownRes.razor index 1906dd8..c636c56 100644 --- a/MatrixUtils.Web/Pages/Dev/WellKnownRes.razor +++ b/MatrixUtils.Web/Pages/Dev/WellKnownRes.razor @@ -8,7 +8,7 @@

Known Homeserver List


-Room ID: Execute +Room ID: Execute Stats:
Server count: @entries.Count
-- cgit 1.5.1