forked from indymedia/epicyon
Check for followers with non-standard paths
parent
08883564d1
commit
2ae4150ba1
21
follow.py
21
follow.py
|
@ -155,7 +155,26 @@ def isFollowerOfPerson(baseDir: str, nickname: str, domain: str,
|
||||||
if not os.path.isfile(followersFile):
|
if not os.path.isfile(followersFile):
|
||||||
return False
|
return False
|
||||||
handle = followerNickname + '@' + followerDomain
|
handle = followerNickname + '@' + followerDomain
|
||||||
return handle in open(followersFile).read()
|
|
||||||
|
alreadyFollowing = False
|
||||||
|
|
||||||
|
followersStr = ''
|
||||||
|
with open(followersFile, 'r') as fpFollowers:
|
||||||
|
followersStr = fpFollowers.read()
|
||||||
|
|
||||||
|
if handle in followersStr:
|
||||||
|
alreadyFollowing = True
|
||||||
|
elif '://' + followerDomain + \
|
||||||
|
'/profile/' + followerNickname in followersStr:
|
||||||
|
alreadyFollowing = True
|
||||||
|
elif '://' + followerDomain + \
|
||||||
|
'/channel/' + followerNickname in followersStr:
|
||||||
|
alreadyFollowing = True
|
||||||
|
elif '://' + followerDomain + \
|
||||||
|
'/accounts/' + followerNickname in followersStr:
|
||||||
|
alreadyFollowing = True
|
||||||
|
|
||||||
|
return alreadyFollowing:
|
||||||
|
|
||||||
|
|
||||||
def unfollowPerson(baseDir: str, nickname: str, domain: str,
|
def unfollowPerson(baseDir: str, nickname: str, domain: str,
|
||||||
|
|
Loading…
Reference in New Issue