Unfollowing

main
Bob Mottram 2020-11-06 18:13:17 +00:00
parent 2028968776
commit 8ca64dd736
1 changed files with 10 additions and 2 deletions

View File

@ -87,6 +87,7 @@ from inbox import populateReplies
from inbox import getPersonPubKey
from follow import getFollowingFeed
from follow import sendFollowRequest
from follow import unfollowPerson
from auth import authorize
from auth import createPassword
from auth import createBasicAuthHeader
@ -1800,7 +1801,6 @@ class PubServer(BaseHTTPRequestHandler):
# person options screen, unfollow button
# See htmlPersonOptions
if '&submitUnfollow=' in optionsConfirmParams:
if debug:
print('Unfollowing ' + optionsActor)
msg = \
htmlUnfollowConfirm(self.server.cssCache,
@ -1959,6 +1959,11 @@ class PubServer(BaseHTTPRequestHandler):
followingNickname = getNicknameFromActor(followingActor)
followingDomain, followingPort = \
getDomainFromActor(followingActor)
followingDomainFull = followingDomain
if followingPort:
if followingPort != 80 and followingPort != 443:
followingDomainFull = \
followingDomain + ':' + str(followingPort)
if followerNickname == followingNickname and \
followingDomain == domain and \
followingPort == port:
@ -1987,6 +1992,9 @@ class PubServer(BaseHTTPRequestHandler):
}
pathUsersSection = path.split('/users/')[1]
self.postToNickname = pathUsersSection.split('/')[0]
unfollowPerson(self.server.baseDir, self.postToNickname,
self.server.domain,
followingNickname, followingDomainFull)
self._postToOutboxThread(unfollowJson)
if callingDomain.endswith('.onion') and onionDomain: