mirror of https://gitlab.com/bashrc2/epicyon
Check for sending to self
parent
a1af245f2d
commit
6d66bbf9ed
28
inbox.py
28
inbox.py
|
@ -2379,19 +2379,21 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
getDomainFromActor(sendingActor)
|
getDomainFromActor(sendingActor)
|
||||||
if not sendingActorDomain:
|
if not sendingActorDomain:
|
||||||
return False
|
return False
|
||||||
|
sendingToSelf = False
|
||||||
|
if sendingActorNickname == nickname and \
|
||||||
|
sendingActorDomain == domain:
|
||||||
|
sendingToSelf = True
|
||||||
# check that the following file exists
|
# check that the following file exists
|
||||||
if not os.path.isfile(followingFilename):
|
if not sendingToSelf:
|
||||||
print('No following.txt file exists for ' +
|
if not os.path.isfile(followingFilename):
|
||||||
nickname + '@' + domain +
|
print('No following.txt file exists for ' +
|
||||||
' so not accepting DM from ' +
|
nickname + '@' + domain +
|
||||||
sendingActorNickname + '@' +
|
' so not accepting DM from ' +
|
||||||
sendingActorDomain)
|
sendingActorNickname + '@' +
|
||||||
return False
|
sendingActorDomain)
|
||||||
# get the handle of the DM sender
|
return False
|
||||||
sendH = \
|
|
||||||
sendingActorNickname + '@' + sendingActorDomain
|
|
||||||
# Not sending to yourself
|
# Not sending to yourself
|
||||||
if sendH != nickname + '@' + domain:
|
if not sendingToSelf:
|
||||||
# check the follow
|
# check the follow
|
||||||
if not isFollowingActor(baseDir,
|
if not isFollowingActor(baseDir,
|
||||||
nickname, domain,
|
nickname, domain,
|
||||||
|
@ -2406,6 +2408,10 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
if not obj.get('inReplyTo'):
|
if not obj.get('inReplyTo'):
|
||||||
senderPostId = \
|
senderPostId = \
|
||||||
postJsonObject['id']
|
postJsonObject['id']
|
||||||
|
# get the handle of the DM sender
|
||||||
|
sendH = \
|
||||||
|
sendingActorNickname + \
|
||||||
|
'@' + sendingActorDomain
|
||||||
_bounceDM(senderPostId,
|
_bounceDM(senderPostId,
|
||||||
session, httpPrefix,
|
session, httpPrefix,
|
||||||
baseDir,
|
baseDir,
|
||||||
|
|
Loading…
Reference in New Issue