From 838541a0da3e11da8ee006f59afe355504d21b6b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Jul 2020 21:55:47 +0100 Subject: [PATCH 1/5] Use lower case --- follow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/follow.py b/follow.py index a66cadf10..439d45b2a 100644 --- a/follow.py +++ b/follow.py @@ -94,7 +94,7 @@ def isFollowingActor(baseDir: str, followingFile = baseDir + '/accounts/' + handle + '/following.txt' if not os.path.isfile(followingFile): return False - if actor in open(followingFile).read(): + if actor.lower() in open(followingFile).read().lower(): return True followingNickname = getNicknameFromActor(actor) if not followingNickname: @@ -106,7 +106,7 @@ def isFollowingActor(baseDir: str, if followingPort != 80 and followingPort != 443: if ':' not in followingHandle: followingHandle += ':' + str(followingPort) - if followingHandle in open(followingFile).read(): + if followingHandle.lower() in open(followingFile).read().lower(): return True return False From a02a01bfaec540a849f831a5694534c4e16c4b39 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Jul 2020 22:23:39 +0100 Subject: [PATCH 2/5] unfollow confirmation --- daemon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon.py b/daemon.py index 16ec828dd..6c61a1798 100644 --- a/daemon.py +++ b/daemon.py @@ -7980,6 +7980,7 @@ class PubServer(BaseHTTPRequestHandler): if not (self.path.endswith('/outbox') or self.path.endswith('/inbox') or self.path.endswith('/shares') or + self.path.endswith('/unfollowconfirm') or self.path.endswith('/moderationaction') or self.path.endswith('/caps/new') or self.path == '/sharedInbox'): From a5af67c669899d4a283445132444db1ebaf99066 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Jul 2020 22:37:06 +0100 Subject: [PATCH 3/5] Pass path instead of actor --- daemon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 6c61a1798..7b6c81562 100644 --- a/daemon.py +++ b/daemon.py @@ -7808,7 +7808,7 @@ class PubServer(BaseHTTPRequestHandler): msg = \ htmlUnfollowConfirm(self.server.translate, self.server.baseDir, - originPathStr, + usersPath, optionsActor, optionsAvatarUrl).encode('utf-8') self._set_headers('text/html', len(msg), @@ -7980,7 +7980,6 @@ class PubServer(BaseHTTPRequestHandler): if not (self.path.endswith('/outbox') or self.path.endswith('/inbox') or self.path.endswith('/shares') or - self.path.endswith('/unfollowconfirm') or self.path.endswith('/moderationaction') or self.path.endswith('/caps/new') or self.path == '/sharedInbox'): From 360b1be9c3a491c401362e91297877f53989fabc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Jul 2020 22:48:39 +0100 Subject: [PATCH 4/5] Case insensitive unfollowing --- follow.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/follow.py b/follow.py index 439d45b2a..06a636554 100644 --- a/follow.py +++ b/follow.py @@ -202,23 +202,25 @@ def unfollowPerson(baseDir: str, nickname: str, domain: str, if debug: print('DEBUG: follow file ' + filename + ' was not found') return False - if handleToUnfollow not in open(filename).read(): + if handleToUnfollow.lower() not in open(filename).read().lower(): if debug: print('DEBUG: handle to unfollow ' + handleToUnfollow + ' is not in ' + filename) return with open(filename, "r") as f: lines = f.readlines() + handleToUnfollowLower = handleToUnfollow.lower() with open(filename, "w") as f: for line in lines: - if line.strip("\n").strip("\r") != handleToUnfollow: + if line.strip("\n").strip("\r").lower() != handleToUnfollowLower: f.write(line) # write to an unfollowed file so that if a follow accept # later arrives then it can be ignored unfollowedFilename = baseDir + '/accounts/' + handle + '/unfollowed.txt' if os.path.isfile(unfollowedFilename): - if handleToUnfollow not in open(unfollowedFilename).read(): + if handleToUnfollowLower not in \ + open(unfollowedFilename).read().lower(): with open(filename, "a+") as f: f.write(handleToUnfollow + '\n') else: From b697195e071fcb95e503117e99d79121ea449f5c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Jul 2020 23:07:02 +0100 Subject: [PATCH 5/5] Tidying of translations --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 789fdbf43..6573ca38c 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,5 @@ clean: rm -f gemini/EN/*~ rm -f scripts/*~ rm -f deploy/*~ + rm -f translations/*~ rm -rf __pycache__