Don't insist on lowercase handle

merge-requests/8/head
Bob Mottram 2020-09-15 10:16:03 +01:00
parent ed0882fec9
commit 99893e5e23
4 changed files with 16 additions and 16 deletions

View File

@ -244,7 +244,7 @@ def clearFollows(baseDir: str, nickname: str, domain: str,
followFile='following.txt') -> None:
"""Removes all follows
"""
handle = nickname.lower() + '@' + domain.lower()
handle = nickname + '@' + domain
if not os.path.isdir(baseDir + '/accounts'):
os.mkdir(baseDir + '/accounts')
if not os.path.isdir(baseDir + '/accounts/' + handle):
@ -269,7 +269,7 @@ def getNoOfFollows(baseDir: str, nickname: str, domain: str,
# account holders
# if not authenticated:
# return 9999
handle = nickname.lower() + '@' + domain.lower()
handle = nickname + '@' + domain
filename = baseDir + '/accounts/' + handle + '/' + followFile
if not os.path.isfile(filename):
return 0
@ -378,7 +378,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
handleDomain = domain
if ':' in handleDomain:
handleDomain = domain.split(':')[0]
handle = nickname.lower() + '@' + handleDomain.lower()
handle = nickname + '@' + handleDomain
filename = baseDir + '/accounts/' + handle + '/' + followFile + '.txt'
if not os.path.isfile(filename):
return following

View File

@ -73,7 +73,7 @@ def setProfileImage(baseDir: str, httpPrefix: str, nickname: str, domain: str,
if ':' not in domain:
fullDomain = domain + ':' + str(port)
handle = nickname.lower() + '@' + domain.lower()
handle = nickname + '@' + domain
personFilename = baseDir + '/accounts/' + handle + '.json'
if not os.path.isfile(personFilename):
print('person definition not found: ' + personFilename)
@ -210,7 +210,7 @@ def createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
storeWebfingerEndpoint(nickname, domain, port,
baseDir, webfingerEndpoint)
handle = nickname.lower() + '@' + domain.lower()
handle = nickname + '@' + domain
originalDomain = domain
if port:
if port != 80 and port != 443:
@ -736,8 +736,8 @@ def setDisplayNickname(baseDir: str, nickname: str, domain: str,
displayName: str) -> bool:
if len(displayName) > 32:
return False
handle = nickname.lower() + '@' + domain.lower()
filename = baseDir + '/accounts/' + handle.lower() + '.json'
handle = nickname + '@' + domain
filename = baseDir + '/accounts/' + handle + '.json'
if not os.path.isfile(filename):
return False
@ -752,8 +752,8 @@ def setDisplayNickname(baseDir: str, nickname: str, domain: str,
def setBio(baseDir: str, nickname: str, domain: str, bio: str) -> bool:
if len(bio) > 32:
return False
handle = nickname.lower() + '@' + domain.lower()
filename = baseDir + '/accounts/' + handle.lower() + '.json'
handle = nickname + '@' + domain
filename = baseDir + '/accounts/' + handle + '.json'
if not os.path.isfile(filename):
return False

View File

@ -327,9 +327,9 @@ def followPerson(baseDir: str, nickname: str, domain: str,
print('DEBUG: follow of domain ' + followDomain)
if ':' in domain:
handle = nickname + '@' + domain.split(':')[0].lower()
handle = nickname + '@' + domain.split(':')[0]
else:
handle = nickname + '@' + domain.lower()
handle = nickname + '@' + domain
if not os.path.isdir(baseDir + '/accounts/' + handle):
print('WARN: account for ' + handle + ' does not exist')

View File

@ -121,11 +121,11 @@ def storeWebfingerEndpoint(nickname: str, domain: str, port: int,
wfSubdir = '/wfendpoints'
if not os.path.isdir(baseDir + wfSubdir):
os.mkdir(baseDir + wfSubdir)
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
filename = baseDir + wfSubdir + '/' + handle + '.json'
saveJson(wfJson, filename)
if nickname == 'inbox':
handle = originalDomain + '@' + domain
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
filename = baseDir + wfSubdir + '/' + handle + '.json'
saveJson(wfJson, filename)
return True
@ -261,7 +261,7 @@ def webfingerLookup(path: str, baseDir: str,
if onionDomain in handle:
handle = handle.replace(onionDomain, domain)
onionify = True
filename = baseDir + '/wfendpoints/' + handle.lower() + '.json'
filename = baseDir + '/wfendpoints/' + handle + '.json'
if debug:
print('DEBUG: WEBFINGER filename ' + filename)
if not os.path.isfile(filename):
@ -339,7 +339,7 @@ def webfingerUpdate(baseDir: str, nickname: str, domain: str,
if not os.path.isdir(baseDir + wfSubdir):
return
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
filename = baseDir + wfSubdir + '/' + handle + '.json'
onionify = False
if onionDomain:
if onionDomain in handle:
@ -352,7 +352,7 @@ def webfingerUpdate(baseDir: str, nickname: str, domain: str,
if not wfJson:
return
actorFilename = baseDir + '/accounts/' + handle.lower() + '.json'
actorFilename = baseDir + '/accounts/' + handle + '.json'
actorJson = loadJson(actorFilename)
if not actorJson:
return