File tree Expand file tree Collapse file tree 8 files changed +13
-0
lines changed
Expand file tree Collapse file tree 8 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 33### Fixed
44
55* Adjusts in settings with options always_online, read_messages and read_status
6+ * Fixed send webhook for event CALL
67
78# 1.4.2 (2023-07-24 20:52)
89
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ WEBHOOK_EVENTS_GROUPS_UPSERT=true
7373WEBHOOK_EVENTS_GROUPS_UPDATE = true
7474WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE = true
7575WEBHOOK_EVENTS_CONNECTION_UPDATE = true
76+ WEBHOOK_EVENTS_CALL = true
7677# This event fires every time a new token is requested via the refresh route
7778WEBHOOK_EVENTS_NEW_JWT_TOKEN = false
7879
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ ENV WEBHOOK_EVENTS_GROUPS_UPSERT=true
7474ENV WEBHOOK_EVENTS_GROUPS_UPDATE=true
7575ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
7676ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true
77+ ENV WEBHOOK_EVENTS_CALL=true
7778
7879ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
7980
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export type EventsWebhook = {
8989 GROUPS_UPSERT : boolean ;
9090 GROUP_UPDATE : boolean ;
9191 GROUP_PARTICIPANTS_UPDATE : boolean ;
92+ CALL : boolean ;
9293 NEW_JWT_TOKEN : boolean ;
9394} ;
9495
@@ -245,6 +246,7 @@ export class ConfigService {
245246 GROUP_UPDATE : process . env ?. WEBHOOK_EVENTS_GROUPS_UPDATE === 'true' ,
246247 GROUP_PARTICIPANTS_UPDATE :
247248 process . env ?. WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE === 'true' ,
249+ CALL : process . env ?. WEBHOOK_EVENTS_CALL === 'true' ,
248250 NEW_JWT_TOKEN : process . env ?. WEBHOOK_EVENTS_NEW_JWT_TOKEN === 'true' ,
249251 } ,
250252 } ,
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ WEBHOOK:
110110 GROUP_UPDATE : true
111111 GROUP_PARTICIPANTS_UPDATE : true
112112 CONNECTION_UPDATE : true
113+ CALL : true
113114 # This event fires every time a new token is requested via the refresh route
114115 NEW_JWT_TOKEN : false
115116
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export const instanceNameSchema: JSONSchema7 = {
5353 'GROUP_UPDATE' ,
5454 'GROUP_PARTICIPANTS_UPDATE' ,
5555 'CONNECTION_UPDATE' ,
56+ 'CALL' ,
5657 'NEW_JWT_TOKEN' ,
5758 ] ,
5859 } ,
@@ -854,6 +855,7 @@ export const webhookSchema: JSONSchema7 = {
854855 'GROUP_UPDATE' ,
855856 'GROUP_PARTICIPANTS_UPDATE' ,
856857 'CONNECTION_UPDATE' ,
858+ 'CALL' ,
857859 'NEW_JWT_TOKEN' ,
858860 ] ,
859861 } ,
Original file line number Diff line number Diff line change @@ -1388,11 +1388,15 @@ export class WAStartupService {
13881388 text : settings . msg_call ,
13891389 } ) ;
13901390
1391+ this . logger . verbose ( 'Sending data to event messages.upsert' ) ;
13911392 this . client . ev . emit ( 'messages.upsert' , {
13921393 messages : [ msg ] ,
13931394 type : 'notify' ,
13941395 } ) ;
13951396 }
1397+
1398+ this . logger . verbose ( 'Sending data to webhook in event CALL' ) ;
1399+ this . sendDataWebhook ( Events . CALL , call ) ;
13961400 }
13971401
13981402 if ( events [ 'connection.update' ] ) {
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export enum Events {
2222 GROUPS_UPSERT = 'groups.upsert' ,
2323 GROUPS_UPDATE = 'groups.update' ,
2424 GROUP_PARTICIPANTS_UPDATE = 'group-participants.update' ,
25+ CALL = 'call' ,
2526}
2627
2728export declare namespace wa {
You can’t perform that action at this time.
0 commit comments