This commit is contained in:
rosetta
2026-01-30 05:01:05 +02:00
commit 83f38dc63f
327 changed files with 18725 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { Attachment, AttachmentType } from "../providers/ProtocolProvider/protocol/packets/packet.message";
export const constructLastMessageTextByAttachments = (attachment: string) => {
let attachmentArray : Attachment[] = JSON.parse(attachment);
if(attachmentArray.length <= 0) {
return "[Unsupported message]";
}
let attach = attachmentArray[0];
switch(attach.type) {
case AttachmentType.IMAGE:
return "$a=Photo";
case AttachmentType.MESSAGES:
return "$a=Forwarded messages";
case AttachmentType.FILE:
return "$a=File";
case AttachmentType.AVATAR:
return "$a=Avatar";
default:
return "[Unsupported attachment]";
}
}