Skip to content

Commit

Permalink
Correção ao responder grupos
Browse files Browse the repository at this point in the history
  • Loading branch information
rtenorioh committed Sep 15, 2022
1 parent 199ba21 commit 9721da1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/src/helpers/SerializeWbotMsgId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ 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}`;

let SeGrupo = 'g.us_' + message.id + '_'+ message.contact.number + '@c.us';
let SeIndiv = 'c.us_' + message.id;

const serializedMsgId = `${message.fromMe}_${ticket.contact.number}@${ticket.isGroup ? SeGrupo : SeIndiv }`;

return serializedMsgId;
};

export default SerializeWbotMsgId;
export default SerializeWbotMsgId;

0 comments on commit 9721da1

Please sign in to comment.