Account moved notification

main
Bob Mottram 2022-12-07 10:39:24 +00:00
parent e162f3693a
commit 4ad132ae07
1 changed files with 19 additions and 0 deletions

View File

@ -259,6 +259,25 @@ function notifications {
fi
fi
# send notifications for moved accounts to XMPP/email users
epicyonMovedFile="$epicyonDir/.newMoved"
if [ -f "$epicyonMovedFile" ]; then
if ! grep -q "##sent##" "$epicyonMovedFile"; then
epicyonMovedMessage=$(notification_translate_text 'has moved to')
epicyonMovedFrom=$(cat "$epicyonMovedFile" | awk -F ' ' '{print $1}')
epicyonMovedTo=$(cat "$epicyonMovedFile" | awk -F ' ' '{print $2}')
epicyonMovedUrl=$(cat "$epicyonMovedFile" | awk -F ' ' '{print $3}')
epicyonMovedLink="<a href=\"${epicyonMovedUrl}\">${epicyonMovedTo}</a>"
epicyonMovedFileContent=$("$(echo "$epicyonMovedFrom")" "$(echo "$epicyonMovedMessage")" "$(echo "$epicyonMovedLink")")
if [[ "$epicyonMovedFileContent" == *':'* ]]; then
epicyonMovedMessage="Epicyon: $epicyonMovedFileContent"
fi
sendNotification "$USERNAME" "Epicyon" "$epicyonMovedMessage"
echo "##sent##" > "$epicyonMovedFile"
chown ${PROJECT_NAME}:${PROJECT_NAME} "$epicyonMovedFile"
fi
fi
# send notifications for emoji reactions to XMPP/email users
epicyonReactionFile="$epicyonDir/.newReaction"
if [ -f "$epicyonReactionFile" ]; then