diff --git a/happening.py b/happening.py index 4e29d98a0..9ff3cec78 100644 --- a/happening.py +++ b/happening.py @@ -1048,6 +1048,7 @@ def _dav_store_event(base_dir: str, nickname: str, domain: str, ], 'replies': { 'id': post_id + '/replies', + 'repliesOf': post_id, 'type': 'Collection', 'first': { 'type': 'CollectionPage', diff --git a/reaction.py b/reaction.py index 9ef705da1..fdc254dc2 100644 --- a/reaction.py +++ b/reaction.py @@ -559,8 +559,14 @@ def update_reaction_collection(recent_posts_cache: {}, if has_object_dict(post_json_object): obj = post_json_object['object'] - if not object_url.endswith('/reactions'): - object_url = object_url + '/reactions' + reactions_ending = '/reactions' + if not object_url.endswith(reactions_ending): + collection_id = object_url + reactions_ending + else: + collection_id = object_url + reactions_ending_len = len(object_url) - len(reactions_ending) + object_url = object_url[:reactions_ending_len] + if not obj.get('reactions'): if debug: print('DEBUG: Adding initial emoji reaction to ' + object_url) @@ -569,7 +575,8 @@ def update_reaction_collection(recent_posts_cache: {}, 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1' ], - 'id': object_url, + 'id': collection_id, + 'reactionsOf': object_url, 'type': 'Collection', "totalItems": 1, 'items': [{