about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Dev/DevUtilities.razor
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-08-06 03:15:16 +0200
committerRory& <root@rory.gay>2025-08-06 03:15:16 +0200
commit89a14526658e5d061b1aef34ab569e979c9c0cf8 (patch)
treef98077d6775e78a77fb142c7f877e44e8af24cf0 /MatrixUtils.Web/Pages/Dev/DevUtilities.razor
parentSynapse admin fixes, variou schanges (diff)
downloadMatrixUtils-89a14526658e5d061b1aef34ab569e979c9c0cf8.tar.xz
Various changes, room create/upgrade work dev/synapse-resync-state
Diffstat (limited to 'MatrixUtils.Web/Pages/Dev/DevUtilities.razor')
-rw-r--r--MatrixUtils.Web/Pages/Dev/DevUtilities.razor31
1 files changed, 30 insertions, 1 deletions
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 <h3>Debug Tools</h3> @@ -14,7 +17,7 @@ else { <summary>Room List</summary> @foreach (var roomId in Rooms) { <a style="color: unset; text-decoration: unset;" href="/RoomStateViewer/@roomId.Replace('.', '~')"> - <RoomListItem RoomInfo="@(new RoomInfo(hs.GetRoom(roomId)))" LoadData="true"></RoomListItem> + <RoomListItem Homeserver="hs" RoomInfo="@(new RoomInfo(hs.GetRoom(roomId)))" LoadData="true"></RoomListItem> </a> } </details> @@ -61,6 +64,7 @@ else { StateHasChanged(); return; } + if (res.Content.Headers.ContentType.MediaType == "application/json") GetRequestResult = $"Error: {res.StatusCode}\n" + (await res.Content.ReadFromJsonAsync<object>()).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