diff options
author | Anton L. Šijanec <sijanecantonluka@gmail.com> | 2020-05-15 13:44:11 +0200 |
---|---|---|
committer | Anton L. Šijanec <sijanecantonluka@gmail.com> | 2020-05-15 13:44:11 +0200 |
commit | 75994d4ddacb3b5c274ef321bc853600a540c76a (patch) | |
tree | 0da44d0dfc51b14cef8cee405e4d1a5d85dd83be /js | |
parent | removed BežiApp from chats sent to GimSIS (diff) | |
download | beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar.gz beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar.bz2 beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar.lz beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar.xz beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.tar.zst beziapp-75994d4ddacb3b5c274ef321bc853600a540c76a.zip |
Diffstat (limited to 'js')
-rw-r--r-- | js/chats.js | 6 |
1 files changed, 5 insertions, 1 deletions
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 = "<!-- ba-ctlmsg-chat-begin -->"; +const CHATS_END_TAG = "<!-- ba-ctlmsg-chat-end -->"; +const CHAT_REGEX = /<!-- ba-ctlmsg-chat-begin -->([\S\s]+?)<!-- ba-ctlmsg-chat-end -->/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) => { |