File tree Expand file tree Collapse file tree
src/api/integrations/channel/meta Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -434,6 +434,13 @@ export class BusinessStartupService extends ChannelStartupService {
434434 if ( received . messages ) {
435435 const message = received . messages [ 0 ] ; // Añadir esta línea para definir message
436436 const remoteJid = createJid ( message ?. to ?? message ?. from ) ;
437+ const contact = await this . prismaRepository . contact . findFirst ( {
438+ where : { instanceId : this . instanceId , remoteJid } ,
439+ } ) ;
440+
441+ if ( ! pushName ) {
442+ pushName = contact ?. pushName ?? incomingContact ?. user_id ?? incomingContact ?. wa_id ?? undefined ;
443+ }
437444
438445 const key = {
439446 id : message . id ,
@@ -740,10 +747,6 @@ export class BusinessStartupService extends ChannelStartupService {
740747 } ) ;
741748 }
742749
743- const contact = await this . prismaRepository . contact . findFirst ( {
744- where : { instanceId : this . instanceId , remoteJid : key . remoteJid } ,
745- } ) ;
746-
747750 const contactPhone = incomingContact ?. profile ?. phone ?? incomingContact ?. wa_id ?? message ?. to ?? message ?. from ;
748751 if ( ! contactPhone ) return ;
749752
You can’t perform that action at this time.
0 commit comments