Fix isGroup (#3380)

* Update Utils.js getChatModel because Meta chat object affected Group Chats

* Ajust to set isGroup as false as default
This commit is contained in:
BenyFilho 2024-11-22 18:55:13 -03:00 • committed by GitHub
commit 301c9af8b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -451,11 +451,12 @@ exports.LoadUtils = () => {
window.WWebJS.getChatModel = async chat => { window.WWebJS.getChatModel = async chat => {
let res = chat.serialize(); let res = chat.serialize();
res.isGroup = chat.isGroup; res.isGroup = false;
res.formattedTitle = chat.formattedTitle; res.formattedTitle = chat.formattedTitle;
res.isMuted = chat.mute && chat.mute.isMuted; res.isMuted = chat.muteExpiration == 0 ? false : true;
if (chat.groupMetadata) { if (chat.groupMetadata) {
res.isGroup = true;
const chatWid = window.Store.WidFactory.createWid((chat.id._serialized)); const chatWid = window.Store.WidFactory.createWid((chat.id._serialized));
await window.Store.GroupMetadata.update(chatWid); await window.Store.GroupMetadata.update(chatWid);
res.groupMetadata = chat.groupMetadata.serialize(); res.groupMetadata = chat.groupMetadata.serialize();