mirror of https://gitlab.com/bashrc2/epicyon
Set other accounts within profile
parent
5779640ecf
commit
c2eed4b762
29
daemon.py
29
daemon.py
|
@ -4311,6 +4311,35 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
del actorJson['movedTo']
|
del actorJson['movedTo']
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
|
|
||||||
|
# Other accounts (alsoKnownAs)
|
||||||
|
alsoKnownAs = []
|
||||||
|
if actorJson.get('alsoKnownAs'):
|
||||||
|
alsoKnownAs = actorJson['alsoKnownAs']
|
||||||
|
if fields.get('alsoKnownAs'):
|
||||||
|
alsoKnownAsStr = ''
|
||||||
|
alsoKnownAsCtr = 0
|
||||||
|
for altActor in alsoKnownAs:
|
||||||
|
if alsoKnownAsCtr > 0:
|
||||||
|
alsoKnownAsStr += ', '
|
||||||
|
alsoKnownAsStr += altActor
|
||||||
|
alsoKnownAsCtr += 1
|
||||||
|
if fields['alsoKnownAs'] != alsoKnownAsStr and \
|
||||||
|
'://' in fields['alsoKnownAs'] and \
|
||||||
|
'@' not in fields['alsoKnownAs'] and \
|
||||||
|
'.' in fields['alsoKnownAs']:
|
||||||
|
newAlsoKnownAs = fields['alsoKnownAs'].split(',')
|
||||||
|
alsoKnownAs = []
|
||||||
|
for altActor in newAlsoKnownAs:
|
||||||
|
altActor = altActor.strip()
|
||||||
|
if '://' in altActor and '.' in altActor:
|
||||||
|
alsoKnownAs.append(altActor)
|
||||||
|
actorJson['alsoKnownAs'] = alsoKnownAs
|
||||||
|
actorChanged = True
|
||||||
|
else:
|
||||||
|
if alsoKnownAs:
|
||||||
|
del actorJson['alsoKnownAs']
|
||||||
|
actorChanged = True
|
||||||
|
|
||||||
# change instance title
|
# change instance title
|
||||||
if fields.get('instanceTitle'):
|
if fields.get('instanceTitle'):
|
||||||
currInstanceTitle = \
|
currInstanceTitle = \
|
||||||
|
|
|
@ -1324,6 +1324,22 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' <textarea id="message" name="bio" style="height:200px">' + \
|
' <textarea id="message" name="bio" style="height:200px">' + \
|
||||||
bioStr + '</textarea>\n'
|
bioStr + '</textarea>\n'
|
||||||
|
|
||||||
|
alsoKnownAsStr = ''
|
||||||
|
if actorJson.get('alsoKnownAs'):
|
||||||
|
alsoKnownAs = actorJson['alsoKnownAs']
|
||||||
|
ctr = 0
|
||||||
|
for altActor in alsoKnownAs:
|
||||||
|
if ctr > 0:
|
||||||
|
alsoKnownAsStr += ', '
|
||||||
|
ctr += 1
|
||||||
|
alsoKnownAsStr += altActor
|
||||||
|
|
||||||
|
editProfileForm += '<label class="labels">' + \
|
||||||
|
translate['Other accounts'] + ':</label><br>\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <input type="text" placeholder="https://..." ' + \
|
||||||
|
'name="otherAccounts" value="' + alsoKnownAsStr + '">\n'
|
||||||
|
|
||||||
editProfileForm += '<label class="labels">' + \
|
editProfileForm += '<label class="labels">' + \
|
||||||
translate['Moved to new account address'] + ':</label><br>\n'
|
translate['Moved to new account address'] + ':</label><br>\n'
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
Loading…
Reference in New Issue