about summary refs log tree commit diff
path: root/LibMatrix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-10 18:31:56 +0100
committerRory& <root@rory.gay>2025-12-10 18:31:56 +0100
commit3290c69b829d3cc66b4c60a5948ce835355b8c9b (patch)
tree173080cc8c19a883aa62acae1783167e935d1dd0 /LibMatrix
parentUpdate contributing docs (diff)
downloadLibMatrix-master.tar.xz
Add thumbnail info and duration for the various file types HEAD master
Diffstat (limited to '')
-rw-r--r--LibMatrix.EventTypes/Spec/RoomMessageEventContent.cs28
1 files changed, 27 insertions, 1 deletions
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<string>? 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; } + + /// <summary> + /// Duration of the audio/video in milliseconds, if applicable + /// </summary> + [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