diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/TimelineComponents')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | 23 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor index 598ae7e..b7e0220 100644 --- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor @@ -1,23 +1,24 @@ -@using MatrixRoomUtils.Core -@using Microsoft.AspNetCore.Components -@if (Event.membership"]!.GetValue<string>() == "ban") { +@using MatrixRoomUtils.Core.Responses +@using MatrixRoomUtils.Core.StateEventTypes + +@if (roomMemberData.Membership == "ban") { <i>@Event.StateKey was banned</i> } -else if (Event.membership"]!.GetValue<string>() == "invite") { +else if (roomMemberData.Membership == "invite") { <i>@Event.StateKey was invited</i> } -else if (Event.membership"]!.GetValue<string>() == "join") { - @if (Event.ReplacesState != null) { - <i>@Event.StateKey changed their display name to @(Event.displayname"]!.GetValue<string>())</i> +else if (roomMemberData.Membership == "join") { + @if (Event.ReplacesState is not null) { + <i>@Event.StateKey changed their display name to @(roomMemberData.Displayname ?? Event.Sender)</i> } else { <i><InlineUserItem UserId="@Event.StateKey"></InlineUserItem> joined</i> } } -else if (Event.membership"]!.GetValue<string>() == "leave") { +else if (roomMemberData.Membership == "leave") { <i>@Event.StateKey left</i> } -else if (Event.membership"]!.GetValue<string>() == "knock") { +else if (roomMemberData.Membership == "knock") { <i>@Event.StateKey knocked</i> } else { @@ -30,6 +31,8 @@ else { @code { [Parameter] - public StateEvent Event { get; set; } + public StateEventResponse Event { get; set; } + + private RoomMemberEventData? roomMemberData => Event.TypedContent as RoomMemberEventData; } \ No newline at end of file diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor index 6c26dc2..b1ce146 100644 --- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMessageItem.razor @@ -1,6 +1,6 @@ @using MatrixRoomUtils.Core.Responses <pre> - @ObjectExtensions.ToJson(Event.Content, indent: false) + @ObjectExtensions.ToJson(Event.RawContent, indent: false) </pre> @code { |