Skip to content

Commit

Permalink
fixes #1614 Whatsapp Clound Connector: Filter incoming message by con…
Browse files Browse the repository at this point in the history
…figured phoneNumberId
  • Loading branch information
Germain Soumier authored and vsct-jburet committed Jun 8, 2024
1 parent 44e3d6d commit 402d254
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class WhatsAppConnectorCloudConnector internal constructor(

private fun handleWebHook(requestBody: WebHookEventReceiveMessage, controller: ConnectorController) {
requestBody.entry.forEach { entry: Entry ->
entry.changes.forEach { change: Change ->
entry.changes.filter {
it.value.metadata.phoneNumberId == phoneNumberId
}.forEach { change: Change ->
change.value.messages.forEach { message: WhatsAppCloudMessage ->
executor.executeBlocking {
val event = WebhookActionConverter.toEvent(message, applicationId)
Expand Down

0 comments on commit 402d254

Please sign in to comment.