From 3f9f054c431ff4272e91048e9d9d0df7a6a68451 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma <32020192+tds-1@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:42:48 +0700 Subject: [PATCH] fix: drop WhatsApp incoming messages from blocked contacts (#14061) ## Linear ticket https://linear.app/chatwoot/issue/CW-6839/blocked-contact-can-still-send-messages-to-whatsapp-inbox ## Description Drop WhatsApp incoming messages from blocked contacts ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Incoming messages for blocked contacts ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Muhsin Keloth --- app/services/whatsapp/incoming_message_base_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/whatsapp/incoming_message_base_service.rb b/app/services/whatsapp/incoming_message_base_service.rb index a8ad176b6..5449c4740 100644 --- a/app/services/whatsapp/incoming_message_base_service.rb +++ b/app/services/whatsapp/incoming_message_base_service.rb @@ -37,6 +37,7 @@ class Whatsapp::IncomingMessageBaseService set_contact return unless @contact + return if @contact.blocked? && !outgoing_echo ActiveRecord::Base.transaction do set_conversation