diff --git a/daemon.py b/daemon.py index 7dfc843c4..d7ebef85a 100644 --- a/daemon.py +++ b/daemon.py @@ -2565,6 +2565,17 @@ class PubServer(BaseHTTPRequestHandler): elif ('@' in searchStr or ('://' in searchStr and hasUsersPath(searchStr))): + if searchStr.endswith(':') or \ + searchStr.endswith(';') or \ + searchStr.endswith('.'): + if callingDomain.endswith('.onion') and onionDomain: + actorStr = 'http://' + onionDomain + usersPath + elif (callingDomain.endswith('.i2p') and i2pDomain): + actorStr = 'http://' + i2pDomain + usersPath + self._redirect_headers(actorStr + '/search', + cookie, callingDomain) + self.server.POSTbusy = False + return # profile search nickname = getNicknameFromActor(actorStr) if not self.server.session: @@ -2580,8 +2591,7 @@ class PubServer(BaseHTTPRequestHandler): profilePathStr = path.replace('/searchhandle', '') # are we already following the searched for handle? - if isFollowingActor(baseDir, nickname, domain, - searchStr): + if isFollowingActor(baseDir, nickname, domain, searchStr): if not hasUsersPath(searchStr): searchNickname = getNicknameFromActor(searchStr) searchDomain, searchPort = \ diff --git a/migrate.py b/migrate.py index 98df45aee..e7216f81d 100644 --- a/migrate.py +++ b/migrate.py @@ -124,6 +124,9 @@ def _updateMovedHandle(baseDir: str, nickname: str, domain: str, movedToHandle = movedToNickname + '@' + movedToDomainFull handleLower = handle.lower() + refollowFilename = \ + baseDir + '/accounts/' + nickname + '@' + domain + '/refollow.txt' + # unfollow the old handle with open(followingFilename, 'w+') as f: for followHandle in followingHandles: @@ -140,6 +143,14 @@ def _updateMovedHandle(baseDir: str, nickname: str, domain: str, ctr += 1 print('Unfollowed ' + handle + ' who has moved to ' + movedToHandle) + + # save the new handles to the refollow list + if os.path.isfile(refollowFilename): + with open(refollowFilename, 'a+') as f: + f.write(movedToHandle + '\n') + else: + with open(refollowFilename, 'w+') as f: + f.write(movedToHandle + '\n') return ctr