A few more changes, added the ability to show the client in posts.

This commit is contained in:
Storm Dragon 2024-05-12 17:55:17 -04:00
parent a6849cceea
commit 05f236df25
2 changed files with 9 additions and 0 deletions

View File

@ -7,3 +7,5 @@ It can be used to post things you may want to send like playing music, or it can
echo "Hello world" | ./ratatoskr -p echo "Hello world" | ./ratatoskr -p
It's still very much a work in progress, but have fun with it anyway. :) It's still very much a work in progress, but have fun with it anyway. :)
One thing not in help, if you want to display the client in your posts, add showClient="true" to your ~/.config/ratatoskr/default.conf file.

View File

@ -128,6 +128,13 @@ post_status() {
local statusText="$*" local statusText="$*"
statusVisibility="${statusVisibility:-public}" statusVisibility="${statusVisibility:-public}"
statusContent_type="${statusContent_type:-text/markdown}" statusContent_type="${statusContent_type:-text/markdown}"
if [[ "${showClient}" == "true" ]]; then
if [[ "${statusContent_type}" == "text/markdown" ]]; then
statusText+=$'\n'$'\n'"[Posted from Ratatoskr](https://git.stormux.org/storm/ratatoskr)"
else
statusText+=$'\n'$'\n'"Posted from Ratatoskr: https://git.stormux.org/storm/ratatoskr"
fi
fi
local statusJson="$(jq -n --arg status "$statusText" \ local statusJson="$(jq -n --arg status "$statusText" \
--arg spoiler_text "$statusSpoiler_text" \ --arg spoiler_text "$statusSpoiler_text" \
--arg visibility "$statusVisibility" \ --arg visibility "$statusVisibility" \