fix(media): exclude stickers and gifs from media gallery set
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-03-08 20:45:16 +03:00
parent 11d108f0a6
commit 8092cb53c5

View File

@@ -1316,14 +1316,16 @@ function collectMediaItems(
for (const attachment of attachments) {
if (!attachment.file_url) continue;
if (!attachment.file_type.startsWith("image/") && !attachment.file_type.startsWith("video/")) continue;
if (isStickerOrGifMedia(attachment.file_url)) continue;
const type = attachment.file_type.startsWith("image/") ? "image" : "video";
const key = `${type}:${attachment.file_url}`;
if (seen.has(key)) continue;
seen.add(key);
items.push({ url: attachment.file_url, type });
}
if (attachments.length === 0 && message.text && /^https?:\/\//i.test(message.text)) {
if (attachments.length === 0 && message.text && /^https?:\/\//i.test(message.text)) {
if (message.type !== "image" && message.type !== "video" && message.type !== "circle_video") continue;
if (isStickerOrGifMedia(message.text)) continue;
const type = message.type === "image" ? "image" : "video";
const key = `${type}:${message.text}`;
if (seen.has(key)) continue;