Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/WhatsApp/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public record AudioContent(string Id, string Mime, string Sha256) : MediaContent
/// <param name="Sha256">Hash of the image.</param>
public record ImageContent(string Id, string Mime, string Sha256) : MediaContent(Id, Mime, Sha256)
{
/// <summary>
/// Optional caption for the image.
/// </summary>
public string? Caption { get; init; }

/// <inheritdoc/>
[JsonIgnore]
public override ContentType Type => ContentType.Image;
Expand All @@ -129,6 +134,11 @@ public record ImageContent(string Id, string Mime, string Sha256) : MediaContent
/// <param name="Sha256">Hash of the video.</param>
public record VideoContent(string Id, string Mime, string Sha256) : MediaContent(Id, Mime, Sha256)
{
/// <summary>
/// Optional caption for the image.
/// </summary>
public string? Caption { get; init; }

/// <inheritdoc/>
[JsonIgnore]
public override ContentType Type => ContentType.Video;
Expand Down
1 change: 1 addition & 0 deletions src/WhatsApp/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ .value.messages[0] as $msg |
{
"$type": $msgType,
"id": $msg[$msgType].id,
"caption": $msg[$msgType].caption,
"mime": $msg[$msgType].mime_type,
"sha256": $msg[$msgType].sha256
}
Expand Down