Notifications should only be for posts written by the selected account

main
Bob Mottram 2021-07-07 10:36:53 +01:00
parent 804c045a75
commit 21a9e06c26
1 changed files with 12 additions and 9 deletions

View File

@ -2533,15 +2533,18 @@ 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? # should we notify that a post from this person has arrived?
if not postIsDM: # This is for cases where the notify checkbox is enabled
fromNickname = getNicknameFromActor(postJsonObject['actor']) # on the person options screen
fromDomain, fromPort = \ if not postIsDM and postJsonObject.get('attributedTo'):
getDomainFromActor(postJsonObject['actor']) attributedTo = postJsonObject['attributedTo']
fromDomainFull = getFullDomain(fromDomain, fromPort) if isinstance(attributedTo, str):
if notifyWhenPersonPosts(baseDir, nickname, domain, fromNickname = getNicknameFromActor(attributedTo)
fromNickname, fromDomainFull): fromDomain, fromPort = getDomainFromActor(attributedTo)
postId = removeIdEnding(postJsonObject['id']) fromDomainFull = getFullDomain(fromDomain, fromPort)
_notifyPostArrival(baseDir, handle, postId) if notifyWhenPersonPosts(baseDir, nickname, domain,
fromNickname, fromDomainFull):
postId = removeIdEnding(postJsonObject['id'])
_notifyPostArrival(baseDir, handle, postId)
# If this is a reply to a muted post then also mute it. # If this is a reply to a muted post then also mute it.
# This enables you to ignore a threat that's getting boring # This enables you to ignore a threat that's getting boring