Closed dtcooper closed 3 years ago
(I suppose I could just use unicode escape character \u003b
)
@dtcooper , in hasses.c+1020, @hyper-prog made a specific check to look for semicolon as delimiter and trimming the message before sending the remaining message. But I believe, unfortunately this doesnt work when we have message format as token=data where every data segment needs token else it gets failed in sendmessages api of chat.c. @hyper-prog , can you let us know, why semicolon as delim is added to trim the message..
Hi, All!
The answer is located in the main readme under the "Debugging" title where the available commands are listed.
"<token>=<message>;<token2>=<message2>" - Send more messages
The hasses can receive more commands in one message in a way the commands are separated by semicolon. (Just like unix commands) So it means that hasses not only trim semicolons, it splits the incoming data by semicolons and interprets the commands each. This is a feature of hasses, not come from SSE specification. To avoid this problem, I suggest you to encode the JSON data with base64.
Sounds good. I'll use {"key": "\u003b <rest of JSON string...>"}"
for JSON for my needs. Cheers and thanks for hasses!
To reproduce, run hasses in first shell,
Then subscribe and wait in another shell,
Finally, test out some JSON as a message in third shell,
Expected:
However, I get the following along with this error message in the hasses shell:
Wrong formatted message from communication channel (2), ignored.
Is there a way to encode a semi-colon for JSON purposes here?
Thanks,
David