diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-30 03:36:58 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-30 03:36:58 +0200 |
commit | bb8c2637af3b7982e7a4b2fd15e2fbec613d0848 (patch) | |
tree | b8075ba7e507aad3f96f354712ad920ac421e474 /MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | |
parent | Update stuff (diff) | |
download | MatrixUtils-bb8c2637af3b7982e7a4b2fd15e2fbec613d0848.tar.xz |
Todays progress
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | 23 |
1 files changed, 13 insertions, 10 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 |