Check nickname and domain

main
Bob Mottram 2020-07-08 22:04:19 +01:00
parent 451714e280
commit 290ea18b0b
1 changed files with 7 additions and 1 deletions

View File

@ -1719,9 +1719,15 @@ def likeNotify(baseDir: str, handle: str, actor: str, url: str) -> None:
# the liked post is one which you made # the liked post is one which you made
if actor not in url: if actor not in url:
return return
likerNickname = None
likerDomain = None
likerNickname = getNicknameFromActor(actor) likerNickname = getNicknameFromActor(actor)
likerDomain, likerPort = getDomainFromActor(actor) likerDomain, likerPort = getDomainFromActor(actor)
if likerNickname and likerDomain:
likerHandle = likerNickname + '@' + likerDomain likerHandle = likerNickname + '@' + likerDomain
else:
print('likeNotify actor: ' + str(actor))
likerHandle = actor
if likerHandle != handle: if likerHandle != handle:
with open(likeFile, 'w') as fp: with open(likeFile, 'w') as fp:
fp.write(likerHandle + ' ' + url) fp.write(likerHandle + ' ' + url)