From 8e913236e5f238f1ba60fae3618284043708f4c9 Mon Sep 17 00:00:00 2001 From: "Cayo P. R. Oliveira" Date: Tue, 29 Apr 2025 20:57:36 -0300 Subject: [PATCH] feat: baileys messages reactions (#33) * fix: update send_message method to handle baileys-api send-message changes * chore: simplify update of is_unsupported * feat: add support for message reactions in WhatsApp Baileys service * chore: update context description for unsupported message in send_message spec * feat: enhance incoming messages Baileys service to support message reactions and external source ID handling * fix: correct typo in comment for is_reaction attribute in Message model * chore: simplify message handling by removing external source ID checks and unused methods * fix: update comment to reflect necessary change for source_id in set_contact method * fix: refactor message handling for reactions and simplify jid generation * fix: add comment to clarify behavior of find_message_by_source_id method * fix: update unsupported message handling * chore: specs for reaction messages * fix: simplify message update handling by removing redundant validation method * fix: update reaction message handling to use in_reply_to_external_id and fix spec * fix: enhance message handling for unsupported types and update specs * fix: update reaction message handling to set is_reaction flag and enhance specs * fix: update specs for send message in reaction * revert: remove mb0 from input * fix: streamline jid generation in send_message_request * refactor: specs * refactor: move content attributes to helper * test: spec for empty reaction * refactor: streamline references to replied message * test: refactor spec * test: refactor spec --------- Co-authored-by: gabrieljablonski --- .../components/widgets/forms/Input.vue | 1 - app/models/message.rb | 3 +- .../incoming_message_baileys_service.rb | 24 +++++++--- .../providers/whatsapp_baileys_service.rb | 19 +++++++- .../incoming_message_baileys_service_spec.rb | 47 ++++++++++++++++++- .../whatsapp_baileys_service_spec.rb | 37 ++++++++++++++- 6 files changed, 117 insertions(+), 14 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/forms/Input.vue b/app/javascript/dashboard/components/widgets/forms/Input.vue index 477aec3dd..b6ee69ec8 100644 --- a/app/javascript/dashboard/components/widgets/forms/Input.vue +++ b/app/javascript/dashboard/components/widgets/forms/Input.vue @@ -63,7 +63,6 @@ export default {