about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-09 07:38:33 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-09 07:38:33 +0100
commitc37bcb0e4a878d4f4c0e47988adb8624131c82cd (patch)
tree706f5300ce83b511d807decddd5b3521168b5fc7 /MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
parentFix updates (diff)
downloadMatrixUtils-c37bcb0e4a878d4f4c0e47988adb8624131c82cd.tar.xz
event types
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor27
1 files changed, 27 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
new file mode 100644

index 0000000..eeec3de --- /dev/null +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomNameItem.razor
@@ -0,0 +1,27 @@ +@using ArcaneLibs.Extensions +@using LibMatrix.EventTypes.Spec.State +@using LibMatrix.Responses +@inherits BaseTimelineItem + +@if (currentEventContent is not null) { + @if (previousEventContent is null) { + <i><InlineUserItem User="@CurrentSenderProfile" Homeserver="@Homeserver" UserId="@Event.StateKey"></InlineUserItem> set the room name to "@currentEventContent.Name"</i> + } + else { + <i><InlineUserItem User="@CurrentSenderProfile" Homeserver="@Homeserver" UserId="@Event.StateKey"></InlineUserItem> changed the room name from "@previousEventContent.Name" to "@currentEventContent.Name"</i> + } +} +else { + <details> + <summary>Unknown event @Event.Type (@Event.StateKey)</summary> + <pre> + @Event.ToJson() + </pre> + </details> +} + +@code { + private RoomNameEventContent? previousEventContent => PreviousState?.TypedContent as RoomNameEventContent; + + private RoomNameEventContent? currentEventContent => Event.TypedContent as RoomNameEventContent; +} \ No newline at end of file