\n'
for emoji_content in item:
emoji_content_encoded = urllib.parse.quote_plus(emoji_content)
emoji_url = \
base_url + '?react=' + post_id + \
- '?actor=' + post_json_object['actor'] + \
+ '?actor=' + actor_url + \
'?tl=' + box_name + \
'?page=' + str(page_number) + \
'?emojreact=' + emoji_content_encoded
diff --git a/webapp_profile.py b/webapp_profile.py
index a8d7301ee..7618e1b03 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -39,6 +39,7 @@ from utils import get_reply_interval_hours
from utils import get_account_timezone
from utils import remove_eol
from utils import is_valid_date
+from utils import get_actor_from_post
from languages import get_actor_languages
from skills import get_skills
from theme import get_themes_list
@@ -167,8 +168,9 @@ def _valid_profile_preview_post(post_json_object: {},
return False, None
# convert actor back to id
if isinstance(post_json_object['actor'], dict):
- if post_json_object['actor'].get('id'):
- post_json_object['actor'] = post_json_object['actor']['id']
+ actor_url = get_actor_from_post(post_json_object)
+ if actor_url:
+ post_json_object['actor'] = actor_url
if has_object_dict(post_json_object):
# convert attributedTo actor back to id
if post_json_object['object'].get('attributedTo'):
@@ -178,7 +180,8 @@ def _valid_profile_preview_post(post_json_object: {},
post_json_object['object']['attributedTo'] = \
post_json_object['object']['attributedTo']['id']
if not is_announced_feed_item:
- if post_json_object['actor'] != person_url and \
+ actor_url = get_actor_from_post(post_json_object)
+ if actor_url != person_url and \
post_json_object['object']['type'] != 'Page':
return False, None
return True, post_json_object
diff --git a/webapp_timeline.py b/webapp_timeline.py
index 267b80cf9..f5f0842ce 100644
--- a/webapp_timeline.py
+++ b/webapp_timeline.py
@@ -20,6 +20,7 @@ from utils import acct_dir
from utils import is_float
from utils import local_actor_url
from utils import remove_eol
+from utils import get_actor_from_post
from follow import follower_approval_active
from person import is_person_snoozed
from markdown import markdown_to_html
@@ -1188,7 +1189,7 @@ def html_individual_share(domain: str, share_id: str,
contact_title_str = translate['Request to stay']
button_style_str = 'contactbutton'
- contact_actor = shared_item['actor']
+ contact_actor = get_actor_from_post(shared_item)
profile_str += \
'
' + \
'