mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
feat: implement link embed functionality to enhance message previews with metadata and thumbnails
This commit is contained in:
@@ -13,4 +13,11 @@ public static class HubConstants
|
||||
public const int AsciiArtWidth = 80;
|
||||
public const int AsciiArtHeight = 40;
|
||||
public const int AsciiArtHeightHalfBlock = 80;
|
||||
|
||||
// Link embed constants
|
||||
public const int EmbedThumbnailWidth = 24;
|
||||
public const int EmbedThumbnailHeight = 12;
|
||||
public const int EmbedMaxDescriptionLength = 200;
|
||||
public const int EmbedMaxHtmlBytes = 64 * 1024; // 64 KB
|
||||
public const int EmbedFetchTimeoutSeconds = 3;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ public record MessageDto(
|
||||
MessageType Type,
|
||||
string? AttachmentUrl,
|
||||
string? AttachmentFileName,
|
||||
DateTimeOffset SentAt);
|
||||
DateTimeOffset SentAt,
|
||||
EmbedDto? Embed = null);
|
||||
|
||||
public record ChannelDto(
|
||||
Guid Id,
|
||||
@@ -36,3 +37,10 @@ public record CreateChannelRequest(string Name, string? Topic = null, bool IsPub
|
||||
public record UpdateTopicRequest(string? Topic);
|
||||
|
||||
public record SendUrlRequest(string Url);
|
||||
|
||||
public record EmbedDto(
|
||||
string? SiteName,
|
||||
string? Title,
|
||||
string? Description,
|
||||
string? ImageAscii,
|
||||
string Url);
|
||||
|
||||
@@ -7,6 +7,7 @@ public class Message
|
||||
public MessageType Type { get; set; } = MessageType.Text;
|
||||
public string? AttachmentUrl { get; set; }
|
||||
public string? AttachmentFileName { get; set; }
|
||||
public string? EmbedJson { get; set; }
|
||||
public DateTimeOffset SentAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
|
||||
public Guid ChannelId { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user