From 3290c69b829d3cc66b4c60a5948ce835355b8c9b Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 10 Dec 2025 18:31:56 +0100 Subject: Add thumbnail info and duration for the various file types --- .../Spec/RoomMessageEventContent.cs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs') diff --git a/LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs b/LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs index d1cf8be..ccb5d42 100644 --- a/LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs +++ b/LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs @@ -11,6 +11,9 @@ public class RoomMessageEventContent : TimelineEventContent { Body = body ?? ""; } + // TODO: https://spec.matrix.org/v1.16/client-server-api/#mimage + // TODO: add `file` for e2ee files + [JsonPropertyName("body")] public string Body { get; set; } @@ -53,7 +56,7 @@ public class RoomMessageEventContent : TimelineEventContent { public class MentionsStruct { [JsonPropertyName("user_ids")] public List? Users { get; set; } - + [JsonPropertyName("room")] public bool? Room { get; set; } } @@ -68,10 +71,33 @@ public class RoomMessageEventContent : TimelineEventContent { [JsonPropertyName("thumbnail_url")] public string? ThumbnailUrl { get; set; } + [JsonPropertyName("thumbnail_info")] + public ThumbnailInfoStruct? ThumbnailInfo { get; set; } + [JsonPropertyName("w")] public int? Width { get; set; } [JsonPropertyName("h")] public int? Height { get; set; } + + /// + /// Duration of the audio/video in milliseconds, if applicable + /// + [JsonPropertyName("duration")] + public long? Duration { get; set; } + + public class ThumbnailInfoStruct { + [JsonPropertyName("w")] + public int? Width { get; set; } + + [JsonPropertyName("h")] + public int? Height { get; set; } + + [JsonPropertyName("mimetype")] + public string? MimeType { get; set; } + + [JsonPropertyName("size")] + public long? Size { get; set; } + } } } \ No newline at end of file -- cgit 1.5.1