mirror of https://gitlab.com/bashrc2/epicyon
Include security within @context to indicate ld-signed activities
parent
4ad92bb6d8
commit
1b7f6b234c
|
@ -48,7 +48,10 @@ def _create_accept_reject(federation_list: [],
|
|||
domain = get_full_domain(domain, port)
|
||||
|
||||
new_accept = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': accept_type,
|
||||
'actor': local_actor_url(http_prefix, nickname, domain),
|
||||
'to': [to_url],
|
||||
|
|
15
announce.py
15
announce.py
|
@ -191,7 +191,10 @@ def create_announce(session, base_dir: str, federation_list: [],
|
|||
atom_uri_str = local_actor_url(http_prefix, nickname, full_domain) + \
|
||||
'/statuses/' + status_number
|
||||
new_announce = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'actor': local_actor_url(http_prefix, nickname, full_domain),
|
||||
'atomUri': atom_uri_str,
|
||||
'cc': [],
|
||||
|
@ -296,7 +299,10 @@ def send_announce_via_server(base_dir: str, session,
|
|||
status_number, published = get_status_number()
|
||||
new_announce_id = actor_str + '/statuses/' + status_number
|
||||
new_announce_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'actor': actor_str,
|
||||
'atomUri': new_announce_id,
|
||||
'cc': [cc_url],
|
||||
|
@ -387,7 +393,10 @@ def send_undo_announce_via_server(base_dir: str, session,
|
|||
|
||||
status_number, _ = get_status_number()
|
||||
unannounce_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': actor + '/statuses/' + str(status_number) + '/undo',
|
||||
'type': 'Undo',
|
||||
'actor': actor,
|
||||
|
|
|
@ -133,7 +133,8 @@ def blocked_timeline_json(actor: str, page_number: int, items_per_page: int,
|
|||
|
||||
result_json = {
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1',
|
||||
"https://purl.archive.org/socialweb/blocked"
|
||||
],
|
||||
"id": actor + '?page=' + str(page_number),
|
||||
|
@ -1247,7 +1248,10 @@ def mute_post(base_dir: str, nickname: str, domain: str, port: int,
|
|||
if debug:
|
||||
print('DEBUG: Adding initial mute to ' + post_id)
|
||||
ignores_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': post_id,
|
||||
'type': 'Collection',
|
||||
"totalItems": 1,
|
||||
|
|
25
bookmarks.py
25
bookmarks.py
|
@ -205,7 +205,10 @@ def update_bookmarks_collection(recent_posts_cache: {},
|
|||
if debug:
|
||||
print('DEBUG: Adding initial bookmarks to ' + object_url)
|
||||
bookmarks_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': object_url,
|
||||
'type': 'Collection',
|
||||
"totalItems": 1,
|
||||
|
@ -283,7 +286,10 @@ def bookmark_post(recent_posts_cache: {},
|
|||
full_domain = get_full_domain(domain, port)
|
||||
|
||||
new_bookmark_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Bookmark',
|
||||
'actor': local_actor_url(http_prefix, nickname, full_domain),
|
||||
'object': object_url
|
||||
|
@ -337,7 +343,10 @@ def undo_bookmark_post(recent_posts_cache: {},
|
|||
full_domain = get_full_domain(domain, port)
|
||||
|
||||
new_undo_bookmark_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': local_actor_url(http_prefix, nickname, full_domain),
|
||||
'object': {
|
||||
|
@ -397,7 +406,10 @@ def send_bookmark_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
new_bookmark_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Add",
|
||||
"actor": actor,
|
||||
"to": [actor],
|
||||
|
@ -490,7 +502,10 @@ def send_undo_bookmark_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
new_bookmark_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Remove",
|
||||
"actor": actor,
|
||||
"to": [actor],
|
||||
|
|
|
@ -227,7 +227,10 @@ def _get_replies_to_post(post_json_object: {},
|
|||
if not isinstance(item['cc'], list):
|
||||
continue
|
||||
wrapped_post = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': item['id'] + '/activity',
|
||||
'type': 'Create',
|
||||
'actor': attrib_str,
|
||||
|
@ -343,7 +346,10 @@ def download_conversation_posts(authorized: bool, session,
|
|||
if not isinstance(post_json_object['cc'], list):
|
||||
break
|
||||
wrapped_post = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': post_json_object['id'] + '/activity',
|
||||
'type': 'Create',
|
||||
'actor': attrib_str,
|
||||
|
|
|
@ -919,7 +919,8 @@ def daemon_http_get(self) -> None:
|
|||
actor += '/blocked'
|
||||
blocked_json = {
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1',
|
||||
"https://purl.archive.org/socialweb/blocked"
|
||||
],
|
||||
"id": actor,
|
||||
|
@ -979,7 +980,8 @@ def daemon_http_get(self) -> None:
|
|||
actor += '/pendingFollowers'
|
||||
pending_json = {
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams"
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"id": actor,
|
||||
"type": "OrderedCollection",
|
||||
|
|
|
@ -363,7 +363,10 @@ def announce_button_undo(self, calling_domain: str, path: str,
|
|||
'/users/' + self.post_to_nickname
|
||||
un_repeat_to_str = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
new_undo_announce = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'actor': undo_announce_actor,
|
||||
'type': 'Undo',
|
||||
'cc': [undo_announce_actor + '/followers'],
|
||||
|
|
|
@ -155,7 +155,10 @@ def like_button(self, calling_domain: str, path: str,
|
|||
liked_post_filename = None
|
||||
|
||||
like_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Like',
|
||||
'actor': like_actor,
|
||||
'to': [actor_liked],
|
||||
|
@ -409,7 +412,10 @@ def like_button_undo(self, calling_domain: str, path: str,
|
|||
liked_post_filename = None
|
||||
|
||||
undo_like_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': undo_actor,
|
||||
'to': [actor_liked],
|
||||
|
|
|
@ -177,7 +177,10 @@ def reaction_button(self, calling_domain: str, path: str,
|
|||
reaction_post_filename = None
|
||||
|
||||
reaction_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'EmojiReact',
|
||||
'actor': reaction_actor,
|
||||
'to': [actor_reaction],
|
||||
|
@ -457,7 +460,10 @@ def reaction_button_undo(self, calling_domain: str, path: str,
|
|||
reaction_post_filename = None
|
||||
|
||||
undo_reaction_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': undo_actor,
|
||||
'to': [actor_reaction],
|
||||
|
|
|
@ -928,9 +928,6 @@ def show_replies_to_post(self, authorized: bool,
|
|||
if not os.path.isfile(post_replies_filename):
|
||||
# There are no replies,
|
||||
# so show empty collection
|
||||
context_str = \
|
||||
'https://www.w3.org/ns/activitystreams'
|
||||
|
||||
first_str = \
|
||||
local_actor_url(http_prefix, nickname, domain_full) + \
|
||||
'/statuses/' + status_number + '/replies?page=true'
|
||||
|
@ -944,7 +941,10 @@ def show_replies_to_post(self, authorized: bool,
|
|||
'/statuses/' + status_number + '/replies?page=true'
|
||||
|
||||
replies_json = {
|
||||
'@context': context_str,
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': first_str,
|
||||
'id': id_str,
|
||||
'last': last_str,
|
||||
|
@ -1031,8 +1031,6 @@ def show_replies_to_post(self, authorized: bool,
|
|||
|
||||
# replies exist. Itterate through the
|
||||
# text file containing message ids
|
||||
context_str = 'https://www.w3.org/ns/activitystreams'
|
||||
|
||||
id_str = \
|
||||
local_actor_url(http_prefix, nickname, domain_full) + \
|
||||
'/statuses/' + status_number + '?page=true'
|
||||
|
@ -1042,7 +1040,10 @@ def show_replies_to_post(self, authorized: bool,
|
|||
'/statuses/' + status_number
|
||||
|
||||
replies_json = {
|
||||
'@context': context_str,
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str,
|
||||
'orderedItems': [
|
||||
],
|
||||
|
|
|
@ -103,7 +103,10 @@ def unfollow_confirm(self, calling_domain: str, cookie: str,
|
|||
status_number, _ = get_status_number()
|
||||
follow_id = follow_actor + '/statuses/' + str(status_number)
|
||||
unfollow_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': follow_id + '/undo',
|
||||
'type': 'Undo',
|
||||
'actor': follow_actor,
|
||||
|
|
|
@ -380,7 +380,10 @@ def receive_remove_post(self, calling_domain: str, cookie: str,
|
|||
remove_post_actor
|
||||
]
|
||||
delete_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'actor': remove_post_actor,
|
||||
'object': remove_message_id,
|
||||
'to': to_list,
|
||||
|
|
|
@ -51,7 +51,10 @@ def send_delete_via_server(base_dir: str, session,
|
|||
cc_url = actor + '/followers'
|
||||
|
||||
new_delete_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'actor': actor,
|
||||
'cc': [cc_url],
|
||||
'object': delete_object_url,
|
||||
|
|
28
follow.py
28
follow.py
|
@ -514,7 +514,10 @@ def get_following_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
total_str = \
|
||||
_get_no_of_follows(base_dir, nickname, domain)
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': first_str,
|
||||
'id': id_str,
|
||||
'totalItems': total_str,
|
||||
|
@ -532,7 +535,10 @@ def get_following_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
part_of_str = \
|
||||
local_actor_url(http_prefix, nickname, domain) + '/' + follow_file
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str,
|
||||
'orderedItems': [],
|
||||
'partOf': part_of_str,
|
||||
|
@ -990,7 +996,10 @@ def send_follow_request(session, base_dir: str,
|
|||
unfollowed_filename)
|
||||
|
||||
new_follow_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': follow_actor + '/statuses/' + str(status_number),
|
||||
'type': 'Follow',
|
||||
'actor': follow_actor,
|
||||
|
@ -1052,7 +1061,10 @@ def send_follow_request_via_server(base_dir: str, session,
|
|||
|
||||
status_number, _ = get_status_number()
|
||||
new_follow_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': follow_actor + '/statuses/' + str(status_number),
|
||||
'type': 'Follow',
|
||||
'actor': follow_actor,
|
||||
|
@ -1145,7 +1157,10 @@ def send_unfollow_request_via_server(base_dir: str, session,
|
|||
status_number, _ = get_status_number()
|
||||
|
||||
unfollow_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': follow_actor + '/statuses/' + str(status_number) + '/undo',
|
||||
'type': 'Undo',
|
||||
'actor': follow_actor,
|
||||
|
@ -1587,7 +1602,8 @@ def pending_followers_timeline_json(actor: str, base_dir: str,
|
|||
"""
|
||||
result_json = {
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams"
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"id": actor,
|
||||
"type": "OrderedCollection",
|
||||
|
|
|
@ -98,7 +98,10 @@ def _get_followers_sync_json(base_dir: str,
|
|||
id_str = http_prefix + '://' + domain_full + \
|
||||
'/users/' + nickname + '/followers?domain=' + search_domain
|
||||
sync_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str,
|
||||
'orderedItems': sync_list,
|
||||
'type': 'OrderedCollection'
|
||||
|
|
10
happening.py
10
happening.py
|
@ -1035,7 +1035,10 @@ def _dav_store_event(base_dir: str, nickname: str, domain: str,
|
|||
"type": "Mention"
|
||||
},
|
||||
{
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Event",
|
||||
"name": content,
|
||||
"startTime": start_time,
|
||||
|
@ -1056,7 +1059,10 @@ def _dav_store_event(base_dir: str, nickname: str, domain: str,
|
|||
}
|
||||
if location:
|
||||
event_json['object']['tag'].append({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Place",
|
||||
"name": location
|
||||
})
|
||||
|
|
20
like.py
20
like.py
|
@ -94,7 +94,10 @@ def _create_like(recent_posts_cache: {},
|
|||
full_domain = get_full_domain(domain, port)
|
||||
|
||||
new_like_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Like',
|
||||
'actor': local_actor_url(http_prefix, nickname, full_domain),
|
||||
'object': object_url
|
||||
|
@ -208,7 +211,10 @@ def send_like_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, from_nickname, from_domain_full)
|
||||
|
||||
new_like_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Like',
|
||||
'actor': actor,
|
||||
'object': like_url
|
||||
|
@ -293,7 +299,10 @@ def send_undo_like_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, from_nickname, from_domain_full)
|
||||
|
||||
new_undo_like_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': actor,
|
||||
'object': {
|
||||
|
@ -470,7 +479,10 @@ def update_likes_collection(recent_posts_cache: {},
|
|||
if debug:
|
||||
print('DEBUG: Adding initial like to ' + object_url)
|
||||
likes_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': object_url,
|
||||
'type': 'Collection',
|
||||
"totalItems": 1,
|
||||
|
|
1
media.py
1
media.py
|
@ -637,6 +637,7 @@ def attach_media(base_dir: str, http_prefix: str,
|
|||
if content_license_url or creator:
|
||||
attachment_json['@context'] = [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1',
|
||||
{'schema': 'https://schema.org#'}
|
||||
]
|
||||
if content_license_url:
|
||||
|
|
|
@ -358,7 +358,10 @@ def get_actor_move_json(actor_json: {}) -> {}:
|
|||
return None
|
||||
pub_number, _ = get_status_number()
|
||||
return {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"id": actor_json['id'] + '#moved/' + pub_number,
|
||||
"type": "Move",
|
||||
"actor": actor_json['id'],
|
||||
|
|
5
pgp.py
5
pgp.py
|
@ -643,7 +643,10 @@ def pgp_public_key_upload(base_dir: str, session,
|
|||
# create an actor update
|
||||
status_number, _ = get_status_number()
|
||||
actor_update = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': actor + '#updates/' + status_number,
|
||||
'type': 'Update',
|
||||
'actor': actor,
|
||||
|
|
60
posts.py
60
posts.py
|
@ -1513,7 +1513,10 @@ def _create_post_place_and_time(event_date: str, end_date: str,
|
|||
end_date_str = event_date_str
|
||||
if not schedule_post and not event_uuid:
|
||||
tags.append({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Event",
|
||||
"name": event_name,
|
||||
"startTime": event_date_str,
|
||||
|
@ -1526,7 +1529,10 @@ def _create_post_place_and_time(event_date: str, end_date: str,
|
|||
geocoords_from_map_link(location, 'openstreetmap.org')
|
||||
if latitude and longitude:
|
||||
tags.append({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Place",
|
||||
"name": location,
|
||||
"latitude": latitude,
|
||||
|
@ -1534,7 +1540,10 @@ def _create_post_place_and_time(event_date: str, end_date: str,
|
|||
})
|
||||
else:
|
||||
tags.append({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"type": "Place",
|
||||
"name": location
|
||||
})
|
||||
|
@ -1912,7 +1921,10 @@ def outbox_message_create_wrap(http_prefix: str,
|
|||
if message_json.get('cc'):
|
||||
cc_list = message_json['cc']
|
||||
new_post = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': new_post_id + '/activity',
|
||||
'type': 'Create',
|
||||
'actor': local_actor_url(http_prefix, nickname, domain),
|
||||
|
@ -4391,7 +4403,10 @@ def create_moderation(base_dir: str, nickname: str, domain: str, port: int,
|
|||
page_str = '?page=' + str(page_number)
|
||||
box_url = local_actor_url(http_prefix, nickname, domain) + '/' + boxname
|
||||
box_header = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': box_url + '?page=true',
|
||||
'id': box_url,
|
||||
'last': box_url + '?page=true',
|
||||
|
@ -4399,7 +4414,10 @@ def create_moderation(base_dir: str, nickname: str, domain: str, port: int,
|
|||
'type': 'OrderedCollection'
|
||||
}
|
||||
box_items = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': box_url + page_str,
|
||||
'orderedItems': [
|
||||
],
|
||||
|
@ -4859,7 +4877,10 @@ def _create_box_indexed(recent_posts_cache: {},
|
|||
'unable to convert page number to string')
|
||||
box_url = local_actor_url(http_prefix, nickname, domain) + '/' + boxname
|
||||
box_header = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': box_url + '?page=true',
|
||||
'id': box_url,
|
||||
'last': box_url + '?page=true',
|
||||
|
@ -4867,7 +4888,10 @@ def _create_box_indexed(recent_posts_cache: {},
|
|||
'type': 'OrderedCollection'
|
||||
}
|
||||
box_items = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': box_url + page_str,
|
||||
'orderedItems': [
|
||||
],
|
||||
|
@ -6385,7 +6409,10 @@ def send_block_via_server(base_dir: str, session,
|
|||
cc_url = block_actor + '/followers'
|
||||
|
||||
new_block_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Block',
|
||||
'actor': block_actor,
|
||||
'object': blocked_url,
|
||||
|
@ -6472,7 +6499,10 @@ def send_mute_via_server(base_dir: str, session,
|
|||
handle = replace_users_with_at(actor)
|
||||
|
||||
new_mute_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Ignore',
|
||||
'actor': actor,
|
||||
'to': [actor],
|
||||
|
@ -6555,7 +6585,10 @@ def send_undo_mute_via_server(base_dir: str, session,
|
|||
handle = replace_users_with_at(actor)
|
||||
|
||||
undo_mute_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': actor,
|
||||
'to': [actor],
|
||||
|
@ -6645,7 +6678,10 @@ def send_undo_block_via_server(base_dir: str, session,
|
|||
cc_url = block_actor + '/followers'
|
||||
|
||||
new_block_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': block_actor,
|
||||
'object': {
|
||||
|
|
20
reaction.py
20
reaction.py
|
@ -92,7 +92,10 @@ def _reactionpost(recent_posts_cache: {},
|
|||
full_domain = get_full_domain(domain, port)
|
||||
|
||||
new_reaction_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'EmojiReact',
|
||||
'actor': local_actor_url(http_prefix, nickname, full_domain),
|
||||
'object': object_url,
|
||||
|
@ -216,7 +219,10 @@ def send_reaction_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, from_nickname, from_domain_full)
|
||||
|
||||
new_reaction_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'EmojiReact',
|
||||
'actor': actor,
|
||||
'object': reaction_url,
|
||||
|
@ -304,7 +310,10 @@ def send_undo_reaction_via_server(base_dir: str, session,
|
|||
actor = local_actor_url(http_prefix, from_nickname, from_domain_full)
|
||||
|
||||
new_undo_reaction_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Undo',
|
||||
'actor': actor,
|
||||
'object': {
|
||||
|
@ -550,7 +559,10 @@ def update_reaction_collection(recent_posts_cache: {},
|
|||
if debug:
|
||||
print('DEBUG: Adding initial emoji reaction to ' + object_url)
|
||||
reactions_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': object_url,
|
||||
'type': 'Collection',
|
||||
"totalItems": 1,
|
||||
|
|
|
@ -128,7 +128,10 @@ def get_moved_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
local_actor_url(http_prefix, nickname, domain) + '/moved'
|
||||
total_str = str(len(lines.items()))
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': first_str,
|
||||
'id': id_str,
|
||||
'orderedItems': [],
|
||||
|
@ -147,7 +150,10 @@ def get_moved_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
part_of_str = \
|
||||
local_actor_url(http_prefix, nickname, domain) + '/moved'
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str,
|
||||
'orderedItems': [],
|
||||
'partOf': part_of_str,
|
||||
|
@ -432,7 +438,10 @@ def get_inactive_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
local_actor_url(http_prefix, nickname, domain) + '/inactive'
|
||||
total_str = str(len(lines))
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': first_str,
|
||||
'id': id_str,
|
||||
'orderedItems': [],
|
||||
|
@ -451,7 +460,10 @@ def get_inactive_feed(base_dir: str, domain: str, port: int, path: str,
|
|||
part_of_str = \
|
||||
local_actor_url(http_prefix, nickname, domain) + '/inactive'
|
||||
following = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str,
|
||||
'orderedItems': [],
|
||||
'partOf': part_of_str,
|
||||
|
|
30
shares.py
30
shares.py
|
@ -568,7 +568,10 @@ def get_shares_feed_for_person(base_dir: str,
|
|||
no_of_shares = len(shares_json.items())
|
||||
id_str = local_actor_url(http_prefix, nickname, domain)
|
||||
shares = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'first': id_str + '/' + shares_file_type + '?page=1',
|
||||
'id': id_str + '/' + shares_file_type,
|
||||
'totalItems': str(no_of_shares),
|
||||
|
@ -582,7 +585,10 @@ def get_shares_feed_for_person(base_dir: str,
|
|||
next_page_number = int(page_number + 1)
|
||||
id_str = local_actor_url(http_prefix, nickname, domain)
|
||||
shares = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': id_str + '/' + shares_file_type + '?page=' + str(page_number),
|
||||
'orderedItems': [],
|
||||
'partOf': id_str + '/' + shares_file_type,
|
||||
|
@ -650,7 +656,10 @@ def send_share_via_server(base_dir, session,
|
|||
cc_url = actor + '/followers'
|
||||
|
||||
new_share_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Add',
|
||||
'actor': actor,
|
||||
'target': actor + '/shares',
|
||||
|
@ -764,7 +773,10 @@ def send_undo_share_via_server(base_dir: str, session,
|
|||
cc_url = actor + '/followers'
|
||||
|
||||
undo_share_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Remove',
|
||||
'actor': actor,
|
||||
'target': actor + '/shares',
|
||||
|
@ -873,7 +885,10 @@ def send_wanted_via_server(base_dir, session,
|
|||
cc_url = actor + '/followers'
|
||||
|
||||
new_share_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Add',
|
||||
'actor': actor,
|
||||
'target': actor + '/wanted',
|
||||
|
@ -987,7 +1002,10 @@ def send_undo_wanted_via_server(base_dir: str, session,
|
|||
cc_url = actor + '/followers'
|
||||
|
||||
undo_share_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'type': 'Remove',
|
||||
'actor': actor,
|
||||
'target': actor + '/wanted',
|
||||
|
|
21
tests.py
21
tests.py
|
@ -4147,7 +4147,10 @@ def _test_jsonld():
|
|||
print("test_jsonld")
|
||||
|
||||
jld_document = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"actor": "https://somesite.net/users/gerbil",
|
||||
"description": "My json document",
|
||||
"numberField": 83582,
|
||||
|
@ -4209,7 +4212,10 @@ def _test_jsonld():
|
|||
assert not verify_json_signature(signed_document, public_key_pem)
|
||||
|
||||
jld_document2 = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"actor": "https://somesite.net/users/gerbil",
|
||||
"description": "Another json document",
|
||||
"numberField": 13353,
|
||||
|
@ -8525,8 +8531,15 @@ def _test_book_link(base_dir: str):
|
|||
id_str = actor + '/generatednote/63472854'
|
||||
published = '2024-01-01T10:30:00.2+00:00'
|
||||
post_json_object = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'attachment': [{'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'attachment': [{
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'name': title,
|
||||
'type': 'Document',
|
||||
'url': image_url}],
|
||||
|
|
5
utils.py
5
utils.py
|
@ -3302,7 +3302,10 @@ def update_announce_collection(recent_posts_cache: {},
|
|||
print('DEBUG: Adding initial shares (announcements) to ' +
|
||||
post_url)
|
||||
announcements_json = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': post_url,
|
||||
'type': 'Collection',
|
||||
"totalItems": 1,
|
||||
|
|
|
@ -1440,7 +1440,10 @@ def hashtag_search_json(nickname: str, domain: str, port: int,
|
|||
url = http_prefix + '://' + domain_full + '/tags/' + \
|
||||
hashtag + '?page=' + str(page_number)
|
||||
hashtag_json = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
"@context": [
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
'id': url,
|
||||
'orderedItems': [],
|
||||
'totalItems': 0,
|
||||
|
|
|
@ -625,7 +625,8 @@ def get_shares_collection(actor: str, page_number: int, items_per_page: int,
|
|||
|
||||
result_json = {
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams"
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1'
|
||||
],
|
||||
"id": actor + '?page=' + str(page_number),
|
||||
"type": "OrderedCollection",
|
||||
|
|
Loading…
Reference in New Issue