Include federation list

master
Bob Mottram 2019-07-17 11:38:10 +01:00
parent c55b5c9e15
commit a47538653a
2 changed files with 12 additions and 7 deletions

View File

@ -84,11 +84,11 @@ def unfollowPerson(baseDir: str,nickname: str, domain: str, \
f.write(line)
def unfollowerOfPerson(baseDir: str,nickname: str,domain: str, \
followerNickname: str,followerDomain: str) -> None:
followerNickname: str,followerDomain: str) -> bool:
"""Remove a follower of a person
"""
unfollowPerson(baseDir,nickname,domain, \
followerNickname,followerDomain,'followers.txt')
return unfollowPerson(baseDir,nickname,domain, \
followerNickname,followerDomain,'followers.txt')
def clearFollows(baseDir: str,nickname: str,domain: str, \
followFile='following.txt') -> None:

View File

@ -380,7 +380,9 @@ def inboxPostRecipients(baseDir :str,postJsonObject :{},httpPrefix :str,domain :
return recipientsDict,recipientsDictFollowers
def receiveUndoFollow(session,baseDir: str,httpPrefix: str, \
port: int,messageJson: {},debug : bool) -> bool:
port: int,messageJson: {}, \
federationList: [], \
debug : bool) -> bool:
if not messageJson['object'].get('actor'):
if debug:
print('DEBUG: follow request has no actor within object')
@ -408,8 +410,9 @@ def receiveUndoFollow(session,baseDir: str,httpPrefix: str, \
if portFollowing!=80 and portFollowing!=443:
domainFollowingFull=domainFollowing+':'+str(portFollowing)
unfollowerOfPerson(baseDir,nicknameFollower,domainFollowerFull, \
nicknameFollowing,domainFollowingFull,federationList,debug)
if not unfollowerOfPerson(baseDir,nicknameFollower,domainFollowerFull, \
nicknameFollowing,domainFollowingFull, \
federationList,debug)
return True
def receiveUndo(session,baseDir: str,httpPrefix: str, \
@ -452,7 +455,9 @@ def receiveUndo(session,baseDir: str,httpPrefix: str, \
return False
if messageJson['object']['type']=='Follow':
return receiveUndoFollow(session,baseDir,httpPrefix, \
port,messageJson,debug)
port,messageJson, \
federationList, \
debug)
return False
def receiveUpdate(session,baseDir: str, \