forked from indymedia/epicyon
Include federation list
parent
c55b5c9e15
commit
a47538653a
|
@ -84,11 +84,11 @@ def unfollowPerson(baseDir: str,nickname: str, domain: str, \
|
||||||
f.write(line)
|
f.write(line)
|
||||||
|
|
||||||
def unfollowerOfPerson(baseDir: str,nickname: str,domain: str, \
|
def unfollowerOfPerson(baseDir: str,nickname: str,domain: str, \
|
||||||
followerNickname: str,followerDomain: str) -> None:
|
followerNickname: str,followerDomain: str) -> bool:
|
||||||
"""Remove a follower of a person
|
"""Remove a follower of a person
|
||||||
"""
|
"""
|
||||||
unfollowPerson(baseDir,nickname,domain, \
|
return unfollowPerson(baseDir,nickname,domain, \
|
||||||
followerNickname,followerDomain,'followers.txt')
|
followerNickname,followerDomain,'followers.txt')
|
||||||
|
|
||||||
def clearFollows(baseDir: str,nickname: str,domain: str, \
|
def clearFollows(baseDir: str,nickname: str,domain: str, \
|
||||||
followFile='following.txt') -> None:
|
followFile='following.txt') -> None:
|
||||||
|
|
13
inbox.py
13
inbox.py
|
@ -380,7 +380,9 @@ def inboxPostRecipients(baseDir :str,postJsonObject :{},httpPrefix :str,domain :
|
||||||
return recipientsDict,recipientsDictFollowers
|
return recipientsDict,recipientsDictFollowers
|
||||||
|
|
||||||
def receiveUndoFollow(session,baseDir: str,httpPrefix: str, \
|
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 not messageJson['object'].get('actor'):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: follow request has no actor within object')
|
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:
|
if portFollowing!=80 and portFollowing!=443:
|
||||||
domainFollowingFull=domainFollowing+':'+str(portFollowing)
|
domainFollowingFull=domainFollowing+':'+str(portFollowing)
|
||||||
|
|
||||||
unfollowerOfPerson(baseDir,nicknameFollower,domainFollowerFull, \
|
if not unfollowerOfPerson(baseDir,nicknameFollower,domainFollowerFull, \
|
||||||
nicknameFollowing,domainFollowingFull,federationList,debug)
|
nicknameFollowing,domainFollowingFull, \
|
||||||
|
federationList,debug)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def receiveUndo(session,baseDir: str,httpPrefix: str, \
|
def receiveUndo(session,baseDir: str,httpPrefix: str, \
|
||||||
|
@ -452,7 +455,9 @@ def receiveUndo(session,baseDir: str,httpPrefix: str, \
|
||||||
return False
|
return False
|
||||||
if messageJson['object']['type']=='Follow':
|
if messageJson['object']['type']=='Follow':
|
||||||
return receiveUndoFollow(session,baseDir,httpPrefix, \
|
return receiveUndoFollow(session,baseDir,httpPrefix, \
|
||||||
port,messageJson,debug)
|
port,messageJson, \
|
||||||
|
federationList, \
|
||||||
|
debug)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def receiveUpdate(session,baseDir: str, \
|
def receiveUpdate(session,baseDir: str, \
|
||||||
|
|
Loading…
Reference in New Issue