From 75994d4ddacb3b5c274ef321bc853600a540c76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20L=2E=20=C5=A0ijanec?= Date: Fri, 15 May 2020 13:44:11 +0200 Subject: untested chats.js regex for chats in body --- js/chats.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/chats.js b/js/chats.js index df937cf..24080ca 100644 --- a/js/chats.js +++ b/js/chats.js @@ -1,5 +1,8 @@ // const API_ENDPOINT = "https://gimb.tk/test.php"; const DIRECTORY_URL = "/directory.json"; +const CHATS_BEGIN_TAG = ""; +const CHATS_END_TAG = ""; +const CHAT_REGEX = /([\S\s]+?)/g; // "Global" object for name directory var directory = null; @@ -133,7 +136,8 @@ async function sendMessage(recipient_number = null, body = null) { try { let gsecInstance = new gsec(); gsecInstance.login(username, password).then( () => { - gsecInstance.sendMessage(recipient_number, "ba-ctlmsg-chat-" + body, S("chatExternalInfo") + body).then((value) => { + gsecInstance.sendMessage(recipient_number, "ba-ctlmsg-chat-" + body, S("chatExternalInfo") + CHATS_BEGIN_TAG + body + + CHATS_END_TAG).then((value) => { addMessage(0, body); setLoading(false); }).catch((err) => { -- cgit v1.2.3