mirror of https://gitlab.com/bashrc2/epicyon
Combine with setting hashtags from bio
parent
a2c779acdf
commit
21e8fd8a6d
|
@ -7155,6 +7155,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
actor_changed = True
|
||||
|
||||
# change user bio
|
||||
featured_tags = get_featured_hashtags(actor_json) + ' '
|
||||
actor_json['tag'] = []
|
||||
if fields.get('bio'):
|
||||
if fields['bio'] != actor_json['summary']:
|
||||
|
@ -7172,6 +7173,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.translate)
|
||||
if actor_tags:
|
||||
for _, tag in actor_tags.items():
|
||||
if tag['name'] + ' ' in featured_tags:
|
||||
continue
|
||||
actor_json['tag'].append(tag)
|
||||
actor_changed = True
|
||||
else:
|
||||
|
@ -7180,6 +7183,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
else:
|
||||
if check_name_and_bio:
|
||||
redirect_path = 'previewAvatar'
|
||||
set_featured_hashtags(actor_json, featured_tags, True)
|
||||
|
||||
admin_nickname = \
|
||||
get_config_param(base_dir, 'admin')
|
||||
|
|
|
@ -1946,7 +1946,8 @@ def get_featured_hashtags(actor_json: {}) -> str:
|
|||
return result.strip()
|
||||
|
||||
|
||||
def set_featured_hashtags(actor_json: {}, hashtags: str) -> None:
|
||||
def set_featured_hashtags(actor_json: {}, hashtags: str,
|
||||
append: bool = False) -> None:
|
||||
"""sets featured hashtags
|
||||
"""
|
||||
separator_str = ' '
|
||||
|
@ -1986,4 +1987,7 @@ def set_featured_hashtags(actor_json: {}, hashtags: str) -> None:
|
|||
continue
|
||||
if tag_dict['type'] != 'Hashtag':
|
||||
result.append(tag_dict)
|
||||
actor_json['tag'] = result
|
||||
if not append:
|
||||
actor_json['tag'] = result
|
||||
else:
|
||||
actor_json['tag'] += result
|
||||
|
|
Loading…
Reference in New Issue