diff --git a/newswire.py b/newswire.py index 0944b108..8ce9b48e 100644 --- a/newswire.py +++ b/newswire.py @@ -221,7 +221,16 @@ def addLocalBlogsToNewswire(baseDir: str, newswire: {}, maxBlogsPerAccount: int) -> None: """Adds blogs from this instance into the newswire """ + # get the list of handles who are trusted to post to the newswire + newswireTrusted = '' + newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt' + if os.path.isfile(newswireTrustedFilename): + with open(newswireTrustedFilename, 'r+') as trustFile: + newswireTrusted = trustFile.read() + + # file containing suspended account nicknames suspendedFilename = baseDir + '/accounts/suspended.txt' + # go through each account for subdir, dirs, files in os.walk(baseDir + '/accounts'): for handle in dirs: @@ -229,6 +238,8 @@ def addLocalBlogsToNewswire(baseDir: str, newswire: {}, continue if 'inbox@' in handle: continue + if handle not in newswireTrusted: + continue accountDir = os.path.join(baseDir + '/accounts', handle) # has this account been suspended? @@ -244,10 +255,6 @@ def addLocalBlogsToNewswire(baseDir: str, newswire: {}, if foundSuspended: continue - # has this account been blocked from posting to newswire? - if os.path.isfile(accountDir + '/.noblognewswire'): - continue - # is there a blogs timeline for this account? blogsIndex = accountDir + '/tlblogs.index' if os.path.isfile(blogsIndex):