mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
feat: added new method to fetch old whatsapp messages
This commit is contained in:
12
backend/src/helpers/SerializeWbotMsgId.ts
Normal file
12
backend/src/helpers/SerializeWbotMsgId.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import Message from "../models/Message";
|
||||
import Ticket from "../models/Ticket";
|
||||
|
||||
const SerializeWbotMsgId = (ticket: Ticket, message: Message): string => {
|
||||
const serializedMsgId = `${message.fromMe}_${ticket.contact.number}@${
|
||||
ticket.isGroup ? "g" : "c"
|
||||
}.us_${message.id}`;
|
||||
|
||||
return serializedMsgId;
|
||||
};
|
||||
|
||||
export default SerializeWbotMsgId;
|
||||
Reference in New Issue
Block a user