You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
694 B
22 lines
694 B
using System;
|
|
using DiscordChatExporter.Core.Discord.Data;
|
|
using DiscordChatExporter.Core.Discord.Data.Embeds;
|
|
|
|
namespace DiscordChatExporter.Core.Exporting;
|
|
|
|
internal static class HtmlMessageExtensions
|
|
{
|
|
// Message content is hidden if it's a link to an embedded media
|
|
// https://github.com/Tyrrrz/DiscordChatExporter/issues/682
|
|
public static bool IsContentHidden(this Message message)
|
|
{
|
|
if (message.Embeds.Count != 1)
|
|
return false;
|
|
|
|
var embed = message.Embeds[0];
|
|
|
|
return
|
|
string.Equals(message.Content.Trim(), embed.Url, StringComparison.OrdinalIgnoreCase) &&
|
|
embed.Kind is EmbedKind.Image or EmbedKind.Gifv;
|
|
}
|
|
} |