From c9981f693673c638f2be81a43f31798878d03088 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Oct 2020 14:14:28 +0100 Subject: [PATCH] Check that following file exists --- inbox.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 45478e77..652e9a99 100644 --- a/inbox.py +++ b/inbox.py @@ -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