Use my $DISPLAY_NAME and $MXID in my messages as a signature.

This commit is contained in:
Jordan Bancino 2022-08-12 22:01:27 -04:00
parent 1d0fb32155
commit 3bda6b89bb
1 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,14 @@ if [ -f "$(pwd)/.env" ]; then
. "$(pwd)/.env"
fi
if [ -z "$MXID" ]; then
MXID="@(${USER}:$(hostname)"
fi
if [ -z "$DISPLAY_NAME" ]; then
DISPLAY_NAME=$(getent passwd "$USER" | cut -d ':' -f 5 | cut -d ',' -f 1)
fi
if [ -z "$TELODENDRIA_PUB" ]; then
echo "TELODENDRIA_PUB not set."
exit 1
@ -107,7 +115,7 @@ case "$1" in
msgFile="/tmp/patchmsg-$(date +%s).txt"
$EDITOR "$msgFile"
if [ -f "$msgFile" ]; then
msg="$msg<br><blockquote>$(cat $msgFile)</blockquote>"
msg="$msg<br><blockquote>$(cat $msgFile)<br>&mdash;$DISPLAY_NAME ($MXID)</blockquote>"
fi
matrix_send "$msg"
else