File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -513,7 +513,20 @@ export class ChannelStartupService {
513513 contactFindManyArgs . skip = query . offset * ( validPage - 1 ) ;
514514 }
515515
516- return await this . prismaRepository . contact . findMany ( contactFindManyArgs ) ;
516+ 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+ } ) ;
517530 }
518531
519532 public cleanMessageData ( message : any ) {
You can’t perform that action at this time.
0 commit comments