From 259a0f0750d7076c4ace5169b14af4059eb7096f Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Wed, 18 Dec 2024 18:00:32 +0100 Subject: [PATCH] bug-fixed: block only hidden message --- tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js b/tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js index db8243e..9ae8d99 100644 --- a/tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js +++ b/tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js @@ -26,6 +26,7 @@ class DirMessage { this.token = context.token; this.log = this.context.log; this.supportRequest = this.context.supportRequest + this.hMessage = false } execute(directive, callback) { @@ -70,6 +71,7 @@ class DirMessage { } if (directive.name === Directives.HMESSAGE) { action.attributes.subtype = "info"; + this.hMessage = true; } // if (directive.name === Directives.HMESSAGE) { // action.sender = "tiledesk"; @@ -95,7 +97,7 @@ class DirMessage { const message = action; if (this.log) {console.log("Message to extEndpoint:", JSON.stringify(message))}; - if(this.supportRequest && !this.supportRequest.draft){ + if(this.hMessage && this.supportRequest && !this.supportRequest.draft){ callback(); return; }