fix(media): exclude stickers and gifs from media gallery set
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
@@ -1316,14 +1316,16 @@ function collectMediaItems(
|
|||||||
for (const attachment of attachments) {
|
for (const attachment of attachments) {
|
||||||
if (!attachment.file_url) continue;
|
if (!attachment.file_url) continue;
|
||||||
if (!attachment.file_type.startsWith("image/") && !attachment.file_type.startsWith("video/")) 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 type = attachment.file_type.startsWith("image/") ? "image" : "video";
|
||||||
const key = `${type}:${attachment.file_url}`;
|
const key = `${type}:${attachment.file_url}`;
|
||||||
if (seen.has(key)) continue;
|
if (seen.has(key)) continue;
|
||||||
seen.add(key);
|
seen.add(key);
|
||||||
items.push({ url: attachment.file_url, type });
|
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 (message.type !== "image" && message.type !== "video" && message.type !== "circle_video") continue;
|
||||||
|
if (isStickerOrGifMedia(message.text)) continue;
|
||||||
const type = message.type === "image" ? "image" : "video";
|
const type = message.type === "image" ? "image" : "video";
|
||||||
const key = `${type}:${message.text}`;
|
const key = `${type}:${message.text}`;
|
||||||
if (seen.has(key)) continue;
|
if (seen.has(key)) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user