forked from indymedia/epicyon
Only load the following handles once
parent
ab85b2ea16
commit
f3c4baadb1
6
posts.py
6
posts.py
|
@ -1914,6 +1914,7 @@ def createSharedInboxIndex(baseDir: str,sharedBoxDir: str,postsInBoxDict: {},pos
|
||||||
handle=nickname+'@'+domain
|
handle=nickname+'@'+domain
|
||||||
followingFilename=baseDir+'/accounts/'+handle+'/following.txt'
|
followingFilename=baseDir+'/accounts/'+handle+'/following.txt'
|
||||||
postsInSharedInbox=os.scandir(sharedBoxDir)
|
postsInSharedInbox=os.scandir(sharedBoxDir)
|
||||||
|
followingHandles=None
|
||||||
for postFilename in postsInSharedInbox:
|
for postFilename in postsInSharedInbox:
|
||||||
postFilename=postFilename.name
|
postFilename=postFilename.name
|
||||||
if not postFilename.endswith('.json'):
|
if not postFilename.endswith('.json'):
|
||||||
|
@ -1945,7 +1946,10 @@ def createSharedInboxIndex(baseDir: str,sharedBoxDir: str,postsInBoxDict: {},pos
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# is the actor followed by this account?
|
# is the actor followed by this account?
|
||||||
if not (actorNickname+'@'+actorDomain in open(followingFilename).read()):
|
if not followingHandles:
|
||||||
|
with open(followingFilename, 'r') as followingFile:
|
||||||
|
followingHandles = followingFile.read()
|
||||||
|
if actorNickname+'@'+actorDomain not in followingHandles:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if ocapAlways:
|
if ocapAlways:
|
||||||
|
|
Loading…
Reference in New Issue