Check that following file exists

main
Bob Mottram 2020-10-11 14:14:28 +01:00
parent 7d4926fed9
commit c9981f6936
1 changed files with 10 additions and 3 deletions

View File

@ -2238,10 +2238,17 @@ def inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
sendH = \
sendingActorNickname + '@' + sendingActorDomain
if sendH != nickname + '@' + domain:
if sendH not in open(followingFilename).read():
if not os.path.isfile(followingFilename):
print('No following.txt file exists for ' +
nickname + '@' + domain)
return False
if sendH not in \
open(followingFilename).read():
print(nickname + '@' + domain +
' cannot receive DM from ' + sendH +
' because they do not follow them')
' cannot receive DM from ' +
sendH +
' because they do not ' +
'follow them')
return False
else:
return False