mirror of https://gitlab.com/bashrc2/epicyon
Adding reactionsOf
parent
b0a3a86510
commit
5b1f8c064a
|
@ -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',
|
||||
|
|
13
reaction.py
13
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': [{
|
||||
|
|
Loading…
Reference in New Issue