Unfollowing

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