diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-13 01:49:10 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-13 01:49:10 +0200 |
commit | fc749b3e57098740377e6eabd5d010d133256fa5 (patch) | |
tree | cc97267a3d4222c910769e46bdb37c96c7c31531 /MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | |
parent | unknown changes (diff) | |
download | MatrixUtils-fc749b3e57098740377e6eabd5d010d133256fa5.tar.xz |
Improved many features
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor new file mode 100644 index 0000000..3803d38 --- /dev/null +++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor @@ -0,0 +1,42 @@ +@using MatrixRoomUtils.Core.Extensions +@if (Event.ContentAsJsonNode["membership"]!.GetValue<string>() == "ban") +{ + <i>@Event.StateKey was banned</i> +} +else if (Event.ContentAsJsonNode["membership"]!.GetValue<string>() == "invite") +{ + <i>@Event.StateKey was invited</i> +} +else if (Event.ContentAsJsonNode["membership"]!.GetValue<string>() == "join") +{ + @if (Event.ReplacesState != null) + { + <i>@Event.StateKey changed their display name to @(Event.ContentAsJsonNode["displayname"]!.GetValue<string>())</i> + } + else + { + <i><InlineUserItem UserId="@Event.StateKey"></InlineUserItem> joined</i> + } +} +else if (Event.ContentAsJsonNode["membership"]!.GetValue<string>() == "leave") +{ + <i>@Event.StateKey left</i> +} +else if (Event.ContentAsJsonNode["membership"]!.GetValue<string>() == "knock") +{ + <i>@Event.StateKey knocked</i> +} +else +{ + <i>@Event.StateKey has an unknown state:</i> + <pre> + @Event.ToJson() + </pre> +} + +@code { + + [Parameter] + public StateEvent Event { get; set; } + +} \ No newline at end of file |