forked from indymedia/epicyon
Misleading method name
parent
6667e94021
commit
4e0120929c
16
follow.py
16
follow.py
|
@ -85,6 +85,17 @@ def followerOfPerson(baseDir: str,nickname: str, domain: str, \
|
|||
followerNickname,followerDomain, \
|
||||
federationList,debug,'followers.txt')
|
||||
|
||||
def isfollowerOfPerson(baseDir: str,nickname: str, domain: str, \
|
||||
followerNickname: str, followerDomain: str) -> bool:
|
||||
"""is the given nickname a follower of followerNickname?
|
||||
"""
|
||||
if ':' in domain:
|
||||
domain=domain.split(':')[0]
|
||||
followersFile=baseDir+'/accounts/'+nickname+'@'+domain+'/followers.txt'
|
||||
if not os.path.isfile(followersFile):
|
||||
return False
|
||||
return followerNickname+'@'+followerDomain in open(followersFile).read()
|
||||
|
||||
def unfollowPerson(baseDir: str,nickname: str, domain: str, \
|
||||
followNickname: str, followDomain: str, \
|
||||
followFile='following.txt', \
|
||||
|
@ -410,8 +421,9 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
|
|||
baseDir+'/accounts/'+handleToFollow)
|
||||
return True
|
||||
|
||||
if not followerOfPerson(baseDir,nicknameToFollow,domainToFollowFull, \
|
||||
nickname,domainFull,federationList,debug):
|
||||
if not isFollowerOfPerson(baseDir, \
|
||||
nicknameToFollow,domainToFollowFull, \
|
||||
nickname,domainFull):
|
||||
if debug:
|
||||
print('DEBUG: '+nickname+'@'+domain+ \
|
||||
' is already a follower of '+ \
|
||||
|
|
4
inbox.py
4
inbox.py
|
@ -1315,10 +1315,10 @@ def runInboxQueue(projectVersion: str, \
|
|||
federationList, \
|
||||
debug,projectVersion, \
|
||||
acceptedCaps=["inbox:write","objects:read"]):
|
||||
if debug:
|
||||
print('DEBUG: Follow accepted from '+keyId)
|
||||
os.remove(queueFilename)
|
||||
queue.pop(0)
|
||||
if debug:
|
||||
print('DEBUG: Follow activity for '+keyId+' removed from accepted from queue')
|
||||
continue
|
||||
else:
|
||||
if debug:
|
||||
|
|
Loading…
Reference in New Issue