main
Bob Mottram 2021-07-06 22:53:55 +01:00
parent 71c2794a19
commit 6a73192c24
3 changed files with 7 additions and 7 deletions

View File

@ -2526,8 +2526,8 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
# save the post to file
if saveJson(postJsonObject, destinationFilename):
# should we notify that a post from this person has arrived?
if not postIsDM:
# should we notify that a post from this person has arrived?
handleNickname = handle.split('@')[0]
handleDomain = handle.split('@')[1]
if notifyWhenPersonPosts(baseDir, nickname, domain,

View File

@ -94,8 +94,8 @@ def notifyWhenPersonPosts(baseDir: str, nickname: str, domain: str,
"""
if followingNickname == nickname and followingDomain == domain:
return False
notifyOnPostFilename = baseDir + '/accounts/' + \
nickname + '@' + domain + '/notifyOnPost.txt'
notifyOnPostFilename = \
baseDir + '/accounts/' + nickname + '@' + domain + '/notifyOnPost.txt'
handle = followingNickname + '@' + followingDomain
if not os.path.isfile(notifyOnPostFilename):
# create a new notifyOnPost file

View File

@ -219,12 +219,12 @@ function notifications {
epicyonNotifyFile="$epicyonDir/.newNotifiedPost"
if [ -f "$epicyonNotifyFile" ]; then
if ! grep -q "##sent##" "$epicyonNotifyFile"; then
epicyonReplyMessage=$(notification_translate_text 'New post')
epicyonNotifyFileContent=$(echo "$epicyonReplyMessage")" "$(cat "$epicyonNotifyFile")
epicyonNotifyMessage=$(notification_translate_text 'New post')
epicyonNotifyFileContent=$(echo "$epicyonNotifyMessage")" "$(cat "$epicyonNotifyFile")
if [[ "$epicyonNotifyFileContent" == *':'* ]]; then
epicyonReplyMessage="Epicyon: $epicyonNotifyFileContent"
epicyonNotifyMessage="Epicyon: $epicyonNotifyFileContent"
fi
sendNotification "$USERNAME" "Epicyon" "$epicyonReplyMessage"
sendNotification "$USERNAME" "Epicyon" "$epicyonNotifyMessage"
echo "##sent##" > "$epicyonNotifyFile"
chown ${PROJECT_NAME}:${PROJECT_NAME} "$epicyonNotifyFile"
fi