We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ab75fa commit eeedfb0Copy full SHA for eeedfb0
1 file changed
src/api/services/channel.service.ts
@@ -513,7 +513,20 @@ export class ChannelStartupService {
513
contactFindManyArgs.skip = query.offset * (validPage - 1);
514
}
515
516
- return await this.prismaRepository.contact.findMany(contactFindManyArgs);
+ const contacts = await this.prismaRepository.contact.findMany(contactFindManyArgs);
517
+
518
+ return contacts.map((contact) => {
519
+ const remoteJid = contact.remoteJid;
520
+ const isGroup = remoteJid.endsWith('@g.us');
521
+ const isSaved = !!contact.pushName || !!contact.profilePicUrl;
522
+ const type = isGroup ? 'group' : isSaved ? 'contact' : 'group_member';
523
+ return {
524
+ ...contact,
525
+ isGroup,
526
+ isSaved,
527
+ type,
528
+ };
529
+ });
530
531
532
public cleanMessageData(message: any) {
0 commit comments