forked from Telodendria/Telodendria
Telodendria Bot can now send messages again.
The problem here is that some Matrix homeservers reject requests that don't have a Content-Length. http was not sending a Content-Length because it was reading from standard input. By reading from an actual file, we can actually easily get the size of the file to send as the Content-Length.
This commit is contained in:
parent
2b3d0aaeaf
commit
2f946848cb
1 changed files with 3 additions and 1 deletions
|
@ -30,7 +30,9 @@ matrix_send() {
|
||||||
printf ',"format":"org.matrix.custom.html",'
|
printf ',"format":"org.matrix.custom.html",'
|
||||||
printf '"msgtype":"m.text"'
|
printf '"msgtype":"m.text"'
|
||||||
printf '}'
|
printf '}'
|
||||||
) | http -X PUT -d @- "$HOMESERVER/client/v3/rooms/$PATCHES_ROOM/send/m.room.message/$(date +%s)?access_token=$ACCESS_TOKEN"
|
) > /tmp/tp-$$
|
||||||
|
http -X PUT -d @/tmp/tp-$$ "$HOMESERVER/client/v3/rooms/$PATCHES_ROOM/send/m.room.message/$(date +%s)?access_token=$ACCESS_TOKEN"
|
||||||
|
rm /tmp/tp-$$
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue