mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
71c2794a19
commit
6a73192c24
2
inbox.py
2
inbox.py
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue