sanka-baileyss 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Utils/process-message.js +12 -0
- package/package.json +1 -1
|
@@ -232,6 +232,18 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
232
232
|
verifiedName: participant === null || participant === void 0 ? void 0 : participant.verifiedName
|
|
233
233
|
};
|
|
234
234
|
});
|
|
235
|
+
// Auto-update contacts store so getName() works with participant names
|
|
236
|
+
const contactUpdates = participantsData
|
|
237
|
+
.filter(p => p.notify || p.name || p.verifiedName)
|
|
238
|
+
.map(p => ({
|
|
239
|
+
id: p.jid,
|
|
240
|
+
notify: p.notify,
|
|
241
|
+
name: p.name,
|
|
242
|
+
verifiedName: p.verifiedName
|
|
243
|
+
}));
|
|
244
|
+
if (contactUpdates.length > 0) {
|
|
245
|
+
ev.emit('contacts.update', contactUpdates);
|
|
246
|
+
}
|
|
235
247
|
}
|
|
236
248
|
catch (error) {
|
|
237
249
|
logger === null || logger === void 0 ? void 0 : logger.warn({ error, groupJid: jid }, 'failed to fetch participant names');
|