From e5591eef3850a9796cc87386128651a828b70697 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 6 Oct 2023 18:29:15 +0200 Subject: Small refactors --- .../EventTypes/Spec/RoomMessageEventContent.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 LibMatrix/EventTypes/Spec/RoomMessageEventContent.cs (limited to 'LibMatrix/EventTypes/Spec/RoomMessageEventContent.cs') diff --git a/LibMatrix/EventTypes/Spec/RoomMessageEventContent.cs b/LibMatrix/EventTypes/Spec/RoomMessageEventContent.cs new file mode 100644 index 0000000..f8ee58b --- /dev/null +++ b/LibMatrix/EventTypes/Spec/RoomMessageEventContent.cs @@ -0,0 +1,33 @@ +using System.Text.Json.Serialization; +using LibMatrix.Helpers; +using LibMatrix.Interfaces; + +namespace LibMatrix.EventTypes.Spec; + +[MatrixEvent(EventName = "m.room.message")] +public class RoomMessageEventContent : EventContent { + public RoomMessageEventContent(string? messageType = "m.notice", string? body = null) { + MessageType = messageType; + Body = body; + } + + [JsonPropertyName("body")] + public string Body { get; set; } + + [JsonPropertyName("msgtype")] + public string MessageType { get; set; } = "m.notice"; + + [JsonPropertyName("formatted_body")] + public string FormattedBody { get; set; } + + [JsonPropertyName("format")] + public string Format { get; set; } + + /// + /// Media URI for this message, if any + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + public string? FileName { get; set; } +} -- cgit 1.4.1