@@ -587,6 +587,9 @@ export class WAStartupService {
587
587
const serverUrl = this . configService . get < HttpServer > ( 'SERVER' ) . URL ;
588
588
const we = event . replace ( / [ . - ] / gm, '_' ) . toUpperCase ( ) ;
589
589
const transformedWe = we . replace ( / _ / gm, '-' ) . toLowerCase ( ) ;
590
+ const tzoffset = new Date ( ) . getTimezoneOffset ( ) * 60000 ; //offset in milliseconds
591
+ const localISOTime = new Date ( Date . now ( ) - tzoffset ) . toISOString ( ) ;
592
+ const now = localISOTime ;
590
593
591
594
const expose = this . configService . get < Auth > ( 'AUTHENTICATION' ) . EXPOSE_IN_FETCH_INSTANCES ;
592
595
const tokenStore = await this . repository . auth . find ( this . instanceName ) ;
@@ -621,6 +624,8 @@ export class WAStartupService {
621
624
instance : this . instance . name ,
622
625
data,
623
626
server_url : serverUrl ,
627
+ date_time : now ,
628
+ sender : this . wuid ,
624
629
} ;
625
630
626
631
if ( expose && instanceApikey ) {
@@ -643,6 +648,8 @@ export class WAStartupService {
643
648
instance : this . instance . name ,
644
649
data,
645
650
server_url : serverUrl ,
651
+ date_time : now ,
652
+ sender : this . wuid ,
646
653
} ;
647
654
648
655
if ( expose && instanceApikey ) {
@@ -675,7 +682,7 @@ export class WAStartupService {
675
682
instance : this . instance . name ,
676
683
data,
677
684
destination : this . localWebhook . url ,
678
- ISODatetime : new Date ( ) . toISOString ( ) ,
685
+ date_time : now ,
679
686
sender : this . wuid ,
680
687
server_url : serverUrl ,
681
688
apikey : ( expose && instanceApikey ) || null ,
@@ -696,6 +703,7 @@ export class WAStartupService {
696
703
instance : this . instance . name ,
697
704
data,
698
705
destination : this . localWebhook . url ,
706
+ date_time : now ,
699
707
sender : this . wuid ,
700
708
server_url : serverUrl ,
701
709
} ;
@@ -746,6 +754,7 @@ export class WAStartupService {
746
754
instance : this . instance . name ,
747
755
data,
748
756
destination : localUrl ,
757
+ date_time : now ,
749
758
sender : this . wuid ,
750
759
server_url : serverUrl ,
751
760
} ;
@@ -765,6 +774,7 @@ export class WAStartupService {
765
774
instance : this . instance . name ,
766
775
data,
767
776
destination : localUrl ,
777
+ date_time : now ,
768
778
sender : this . wuid ,
769
779
server_url : serverUrl ,
770
780
} ;
0 commit comments