Closed efelon closed 1 year ago
The culprit adding the \n
is the escape()
function on line 105. More specific the "-s" option for jq.
I tested a little without the -s and it looked good to me.
escape() {
jq -R . <<<"$1"
}
From the man page of jq I see that this (-s and -R) is used to handle multi-line input, useful for message input indeed. But for filename, IDENTIFIER or displayname it should not be there.
One solution could be to test if the input to escape has multiple lines:
escape() {
local multil=
[ $(echo "$1" | wc -l) -gt 1 ] && multil="-s"
jq $multil -R . <<<"$1"
}
This is only a "cosmetics" report.
I'm on
I can send text messages without problems, but when I'm sending a file like this:
/opt/matrix_cli/matrix.sh --identifier='system.internal' --room='!***********:domain.cc' --file="/my/diff.txt"
The raw data of the message show
and when trying to download the file, it will be saved as
diff.txt_
. Content of the file is fine.Let me add that I'm so happy about your script. It also did work right away.