mirror of https://gitlab.com/bashrc2/epicyon
Account moved notification
parent
e162f3693a
commit
4ad132ae07
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue