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
|
# save the post to file
|
||||||
if saveJson(postJsonObject, destinationFilename):
|
if saveJson(postJsonObject, destinationFilename):
|
||||||
|
# should we notify that a post from this person has arrived?
|
||||||
if not postIsDM:
|
if not postIsDM:
|
||||||
# should we notify that a post from this person has arrived?
|
|
||||||
handleNickname = handle.split('@')[0]
|
handleNickname = handle.split('@')[0]
|
||||||
handleDomain = handle.split('@')[1]
|
handleDomain = handle.split('@')[1]
|
||||||
if notifyWhenPersonPosts(baseDir, nickname, domain,
|
if notifyWhenPersonPosts(baseDir, nickname, domain,
|
||||||
|
|
|
@ -94,8 +94,8 @@ def notifyWhenPersonPosts(baseDir: str, nickname: str, domain: str,
|
||||||
"""
|
"""
|
||||||
if followingNickname == nickname and followingDomain == domain:
|
if followingNickname == nickname and followingDomain == domain:
|
||||||
return False
|
return False
|
||||||
notifyOnPostFilename = baseDir + '/accounts/' + \
|
notifyOnPostFilename = \
|
||||||
nickname + '@' + domain + '/notifyOnPost.txt'
|
baseDir + '/accounts/' + nickname + '@' + domain + '/notifyOnPost.txt'
|
||||||
handle = followingNickname + '@' + followingDomain
|
handle = followingNickname + '@' + followingDomain
|
||||||
if not os.path.isfile(notifyOnPostFilename):
|
if not os.path.isfile(notifyOnPostFilename):
|
||||||
# create a new notifyOnPost file
|
# create a new notifyOnPost file
|
||||||
|
|
|
@ -219,12 +219,12 @@ function notifications {
|
||||||
epicyonNotifyFile="$epicyonDir/.newNotifiedPost"
|
epicyonNotifyFile="$epicyonDir/.newNotifiedPost"
|
||||||
if [ -f "$epicyonNotifyFile" ]; then
|
if [ -f "$epicyonNotifyFile" ]; then
|
||||||
if ! grep -q "##sent##" "$epicyonNotifyFile"; then
|
if ! grep -q "##sent##" "$epicyonNotifyFile"; then
|
||||||
epicyonReplyMessage=$(notification_translate_text 'New post')
|
epicyonNotifyMessage=$(notification_translate_text 'New post')
|
||||||
epicyonNotifyFileContent=$(echo "$epicyonReplyMessage")" "$(cat "$epicyonNotifyFile")
|
epicyonNotifyFileContent=$(echo "$epicyonNotifyMessage")" "$(cat "$epicyonNotifyFile")
|
||||||
if [[ "$epicyonNotifyFileContent" == *':'* ]]; then
|
if [[ "$epicyonNotifyFileContent" == *':'* ]]; then
|
||||||
epicyonReplyMessage="Epicyon: $epicyonNotifyFileContent"
|
epicyonNotifyMessage="Epicyon: $epicyonNotifyFileContent"
|
||||||
fi
|
fi
|
||||||
sendNotification "$USERNAME" "Epicyon" "$epicyonReplyMessage"
|
sendNotification "$USERNAME" "Epicyon" "$epicyonNotifyMessage"
|
||||||
echo "##sent##" > "$epicyonNotifyFile"
|
echo "##sent##" > "$epicyonNotifyFile"
|
||||||
chown ${PROJECT_NAME}:${PROJECT_NAME} "$epicyonNotifyFile"
|
chown ${PROJECT_NAME}:${PROJECT_NAME} "$epicyonNotifyFile"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue