diff options
author | Emma@Rory& <root@rory.gay> | 2023-08-14 19:46:33 +0200 |
---|---|---|
committer | Emma@Rory& <root@rory.gay> | 2023-08-14 19:46:33 +0200 |
commit | 83029c478f411bcadd3be53ac4dc53d88b3c8462 (patch) | |
tree | 279d62e53e55e862e4851f1447de12e47e3fce62 /MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | |
parent | Add MxApiExtensions submodule (diff) | |
download | MatrixUtils-83029c478f411bcadd3be53ac4dc53d88b3c8462.tar.xz |
Code cleanup
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor index 8239367..d67fdab 100644 --- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor @@ -4,31 +4,31 @@ @inherits BaseTimelineItem @if (roomMemberData is not null) { - @if (roomMemberData.Membership == "ban") { - <i>@Event.StateKey was banned</i> - } - else if (roomMemberData.Membership == "invite") { - <i>@Event.StateKey was invited</i> - } - else if (roomMemberData.Membership == "join") { - @if (Event.ReplacesState is not null) { + @switch (roomMemberData.Membership) { + case "ban": + <i>@Event.StateKey was banned</i> + break; + case "invite": + <i>@Event.StateKey was invited</i> + break; + case "join" when Event.ReplacesState is not null: <i>@Event.StateKey changed their display name to @(roomMemberData.Displayname ?? Event.Sender)</i> - } - else { - <i><InlineUserItem User="new ProfileResponseEventData()" HomeServer="HomeServer" UserId="@Event.StateKey"></InlineUserItem> joined</i> - } - } - else if (roomMemberData.Membership == "leave") { - <i>@Event.StateKey left</i> - } - else if (roomMemberData.Membership == "knock") { - <i>@Event.StateKey knocked</i> - } - else { - <i>@Event.StateKey has an unknown state:</i> - <pre> + break; + case "join": + <i><InlineUserItem User="@(new ProfileResponseEventData())" HomeServer="@HomeServer" UserId="@Event.StateKey"></InlineUserItem> joined</i> + break; + case "leave": + <i>@Event.StateKey left</i> + break; + case "knock": + <i>@Event.StateKey knocked</i> + break; + default: + <i>@Event.StateKey has an unknown state:</i> + <pre> @Event.ToJson() </pre> + break; } } else { |