mirror of https://gitlab.com/bashrc2/epicyon
Don't insist on lowercase handle
parent
ed0882fec9
commit
99893e5e23
|
@ -244,7 +244,7 @@ def clearFollows(baseDir: str, nickname: str, domain: str,
|
||||||
followFile='following.txt') -> None:
|
followFile='following.txt') -> None:
|
||||||
"""Removes all follows
|
"""Removes all follows
|
||||||
"""
|
"""
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
if not os.path.isdir(baseDir + '/accounts'):
|
if not os.path.isdir(baseDir + '/accounts'):
|
||||||
os.mkdir(baseDir + '/accounts')
|
os.mkdir(baseDir + '/accounts')
|
||||||
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
||||||
|
@ -269,7 +269,7 @@ def getNoOfFollows(baseDir: str, nickname: str, domain: str,
|
||||||
# account holders
|
# account holders
|
||||||
# if not authenticated:
|
# if not authenticated:
|
||||||
# return 9999
|
# return 9999
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
filename = baseDir + '/accounts/' + handle + '/' + followFile
|
filename = baseDir + '/accounts/' + handle + '/' + followFile
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return 0
|
return 0
|
||||||
|
@ -378,7 +378,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
handleDomain = domain
|
handleDomain = domain
|
||||||
if ':' in handleDomain:
|
if ':' in handleDomain:
|
||||||
handleDomain = domain.split(':')[0]
|
handleDomain = domain.split(':')[0]
|
||||||
handle = nickname.lower() + '@' + handleDomain.lower()
|
handle = nickname + '@' + handleDomain
|
||||||
filename = baseDir + '/accounts/' + handle + '/' + followFile + '.txt'
|
filename = baseDir + '/accounts/' + handle + '/' + followFile + '.txt'
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return following
|
return following
|
||||||
|
|
12
person.py
12
person.py
|
@ -73,7 +73,7 @@ def setProfileImage(baseDir: str, httpPrefix: str, nickname: str, domain: str,
|
||||||
if ':' not in domain:
|
if ':' not in domain:
|
||||||
fullDomain = domain + ':' + str(port)
|
fullDomain = domain + ':' + str(port)
|
||||||
|
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
personFilename = baseDir + '/accounts/' + handle + '.json'
|
personFilename = baseDir + '/accounts/' + handle + '.json'
|
||||||
if not os.path.isfile(personFilename):
|
if not os.path.isfile(personFilename):
|
||||||
print('person definition not found: ' + 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,
|
storeWebfingerEndpoint(nickname, domain, port,
|
||||||
baseDir, webfingerEndpoint)
|
baseDir, webfingerEndpoint)
|
||||||
|
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
originalDomain = domain
|
originalDomain = domain
|
||||||
if port:
|
if port:
|
||||||
if port != 80 and port != 443:
|
if port != 80 and port != 443:
|
||||||
|
@ -736,8 +736,8 @@ def setDisplayNickname(baseDir: str, nickname: str, domain: str,
|
||||||
displayName: str) -> bool:
|
displayName: str) -> bool:
|
||||||
if len(displayName) > 32:
|
if len(displayName) > 32:
|
||||||
return False
|
return False
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
filename = baseDir + '/accounts/' + handle.lower() + '.json'
|
filename = baseDir + '/accounts/' + handle + '.json'
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return False
|
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:
|
def setBio(baseDir: str, nickname: str, domain: str, bio: str) -> bool:
|
||||||
if len(bio) > 32:
|
if len(bio) > 32:
|
||||||
return False
|
return False
|
||||||
handle = nickname.lower() + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
filename = baseDir + '/accounts/' + handle.lower() + '.json'
|
filename = baseDir + '/accounts/' + handle + '.json'
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
4
utils.py
4
utils.py
|
@ -327,9 +327,9 @@ def followPerson(baseDir: str, nickname: str, domain: str,
|
||||||
print('DEBUG: follow of domain ' + followDomain)
|
print('DEBUG: follow of domain ' + followDomain)
|
||||||
|
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
handle = nickname + '@' + domain.split(':')[0].lower()
|
handle = nickname + '@' + domain.split(':')[0]
|
||||||
else:
|
else:
|
||||||
handle = nickname + '@' + domain.lower()
|
handle = nickname + '@' + domain
|
||||||
|
|
||||||
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
if not os.path.isdir(baseDir + '/accounts/' + handle):
|
||||||
print('WARN: account for ' + handle + ' does not exist')
|
print('WARN: account for ' + handle + ' does not exist')
|
||||||
|
|
10
webfinger.py
10
webfinger.py
|
@ -121,11 +121,11 @@ def storeWebfingerEndpoint(nickname: str, domain: str, port: int,
|
||||||
wfSubdir = '/wfendpoints'
|
wfSubdir = '/wfendpoints'
|
||||||
if not os.path.isdir(baseDir + wfSubdir):
|
if not os.path.isdir(baseDir + wfSubdir):
|
||||||
os.mkdir(baseDir + wfSubdir)
|
os.mkdir(baseDir + wfSubdir)
|
||||||
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
|
filename = baseDir + wfSubdir + '/' + handle + '.json'
|
||||||
saveJson(wfJson, filename)
|
saveJson(wfJson, filename)
|
||||||
if nickname == 'inbox':
|
if nickname == 'inbox':
|
||||||
handle = originalDomain + '@' + domain
|
handle = originalDomain + '@' + domain
|
||||||
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
|
filename = baseDir + wfSubdir + '/' + handle + '.json'
|
||||||
saveJson(wfJson, filename)
|
saveJson(wfJson, filename)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ def webfingerLookup(path: str, baseDir: str,
|
||||||
if onionDomain in handle:
|
if onionDomain in handle:
|
||||||
handle = handle.replace(onionDomain, domain)
|
handle = handle.replace(onionDomain, domain)
|
||||||
onionify = True
|
onionify = True
|
||||||
filename = baseDir + '/wfendpoints/' + handle.lower() + '.json'
|
filename = baseDir + '/wfendpoints/' + handle + '.json'
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: WEBFINGER filename ' + filename)
|
print('DEBUG: WEBFINGER filename ' + filename)
|
||||||
if not os.path.isfile(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):
|
if not os.path.isdir(baseDir + wfSubdir):
|
||||||
return
|
return
|
||||||
|
|
||||||
filename = baseDir + wfSubdir + '/' + handle.lower() + '.json'
|
filename = baseDir + wfSubdir + '/' + handle + '.json'
|
||||||
onionify = False
|
onionify = False
|
||||||
if onionDomain:
|
if onionDomain:
|
||||||
if onionDomain in handle:
|
if onionDomain in handle:
|
||||||
|
@ -352,7 +352,7 @@ def webfingerUpdate(baseDir: str, nickname: str, domain: str,
|
||||||
if not wfJson:
|
if not wfJson:
|
||||||
return
|
return
|
||||||
|
|
||||||
actorFilename = baseDir + '/accounts/' + handle.lower() + '.json'
|
actorFilename = baseDir + '/accounts/' + handle + '.json'
|
||||||
actorJson = loadJson(actorFilename)
|
actorJson = loadJson(actorFilename)
|
||||||
if not actorJson:
|
if not actorJson:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue