@@ -198,11 +198,13 @@ export class BusinessStartupService extends WAStartupService {
198198 let content : any ;
199199 const message = received . messages [ 0 ] ;
200200 if ( message . from === received . metadata . phone_number_id ) {
201- content = { extendedTextMessage : { text : message . text . body } } ;
202- message . context ? ( content . contextInfo = { stanzaId : message . context . id } ) : content ;
201+ content = {
202+ extendedTextMessage : { text : message . text . body } ,
203+ } ;
204+ message . context ? ( content = { ...content , contextInfo : { stanzaId : message . context . id } } ) : content ;
203205 } else {
204206 content = { conversation : message . text . body } ;
205- message . context ? ( content = { contextInfo : { stanzaId : message . context . id } } ) : content ;
207+ message . context ? ( content = { ... content , contextInfo : { stanzaId : message . context . id } } ) : content ;
206208 }
207209 return content ;
208210 }
@@ -303,6 +305,8 @@ export class BusinessStartupService extends WAStartupService {
303305 let messageRaw : MessageRaw ;
304306 let pushName : any ;
305307
308+ console . log ( 'msg_wa' , received ) ;
309+
306310 if ( received . contacts ) pushName = received . contacts [ 0 ] . profile . name ;
307311
308312 if ( received . messages ) {
@@ -378,6 +382,7 @@ export class BusinessStartupService extends WAStartupService {
378382
379383 this . logger . verbose ( 'Sending data to webhook in event MESSAGES_UPSERT' ) ;
380384
385+ console . log ( 'msg_evo' , messageRaw . message ) ;
381386 this . sendDataWebhook ( Events . MESSAGES_UPSERT , messageRaw ) ;
382387
383388 if ( this . localChatwoot . enabled ) {
@@ -614,7 +619,7 @@ export class BusinessStartupService extends WAStartupService {
614619 message_id : message [ 'reactionMessage' ] [ 'key' ] [ 'id' ] ,
615620 emoji : message [ 'reactionMessage' ] [ 'text' ] ,
616621 } ,
617- // context: { message_id: quoted.id },
622+ context : { message_id : quoted . id } ,
618623 } ;
619624 quoted ? ( content . context = { message_id : quoted . id } ) : content ;
620625 return await this . post ( content , 'messages' ) ;
0 commit comments