Message: Fix showing self-destructing videos

This commit is contained in:
Alexander Zinchuk 2021-10-21 02:05:02 +03:00
parent 46754b9359
commit 577436d0b6

View File

@ -212,6 +212,10 @@ export function buildMessageDraft(draft: GramJs.TypeDraftMessage) {
}
export function buildMessageMediaContent(media: GramJs.TypeMessageMedia): ApiMessage['content'] | undefined {
if ('ttlSeconds' in media && media.ttlSeconds) {
return undefined;
}
const sticker = buildSticker(media);
if (sticker) return { sticker };
@ -278,10 +282,6 @@ function buildPhoto(media: GramJs.TypeMessageMedia): ApiPhoto | undefined {
return undefined;
}
if (media.ttlSeconds) {
return undefined;
}
return buildApiPhoto(media.photo);
}
@ -405,10 +405,6 @@ function buildDocumentFromMedia(media: GramJs.TypeMessageMedia) {
return undefined;
}
if (media.ttlSeconds) {
return undefined;
}
return buildApiDocument(media.document);
}