mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 11:39:14 +00:00
fix: apply message serialization fix everywhere
Moving this to a serializer function like done with a couple other models guarantees getting messages with pending acks won't fail elsewhere. It also sets it up so the we can add/remove properties on the Message model as needed in the future.
related: 51a1028588
This commit is contained in:
@@ -166,6 +166,12 @@ exports.LoadUtils = () => {
|
||||
return mediaData;
|
||||
};
|
||||
|
||||
window.WWebJS.getMessageModel = message => {
|
||||
const msg = message.serialize();
|
||||
delete msg.pendingAckUpdate;
|
||||
return msg;
|
||||
};
|
||||
|
||||
window.WWebJS.getChatModel = async chat => {
|
||||
let res = chat.serialize();
|
||||
res.isGroup = chat.isGroup;
|
||||
|
||||
Reference in New Issue
Block a user