From dc3f6329b2b22cb94e71b667867e085d48527d14 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 19 Jan 2023 18:24:59 -0500 Subject: [PATCH] Style fixes --- accept.jsonld | 4 ++-- create.jsonld | 8 ++++---- follow.jsonld | 4 ++-- server.py | 2 -- users/test.jsonld | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/accept.jsonld b/accept.jsonld index ac00005..15c2ea1 100644 --- a/accept.jsonld +++ b/accept.jsonld @@ -4,10 +4,10 @@ "actor": "https://0.exozy.me/users/test.jsonld", "object": { "@context": "https://www.w3.org/ns/activitystreams", - "id": "https://social.exozy.me/9a9e4ad7-f86a-4190-8782-9df9951c5ff6", "type": "Follow", + "id": "https://social.exozy.me/9a9e4ad7-f86a-4190-8782-9df9951c5ff6", "actor": "https://social.exozy.me/users/a", "object": "https://0.exozy.me/users/test.jsonld" }, - "to": "https://social.exozy.me/users/a" + "to": ["https://social.exozy.me/users/a"] } diff --git a/create.jsonld b/create.jsonld index 224d189..7f420e6 100644 --- a/create.jsonld +++ b/create.jsonld @@ -1,14 +1,14 @@ { "@context": "https://www.w3.org/ns/activitystreams", - "id": "https://0.exozy.me/users/test.outbox#helloworld2", "type": "Create", + "id": "https://0.exozy.me/users/test.outbox#helloworld2", "actor": "https://0.exozy.me/users/test.jsonld", "object": { - "id": "https://0.exozy.me/users/test.statuses/helloworld2", "type": "Note", + "id": "https://0.exozy.me/users/test.statuses/helloworld2", "attributedTo": "https://0.exozy.me/users/test.jsonld", "content": "Hello from fuwuqi 2.0!!! 🙃", - "to": "https://www.w3.org/ns/activitystreams#Public" + "to": ["https://www.w3.org/ns/activitystreams#Public"] }, - "to": "https://0.exozy.me/users/test.followers" + "to": ["https://0.exozy.me/users/test.followers"] } diff --git a/follow.jsonld b/follow.jsonld index c356431..be41818 100644 --- a/follow.jsonld +++ b/follow.jsonld @@ -1,8 +1,8 @@ { "@context": "https://www.w3.org/ns/activitystreams", - "id": "https://0.exozy.me/users/test.outbox#follow", "type": "Follow", + "id": "https://0.exozy.me/users/test.outbox#follow", "actor": "https://0.exozy.me/users/test.jsonld", "object": "https://social.exozy.me/users/a", - "to": "https://social.exozy.me/users/a" + "to": ["https://social.exozy.me/users/a"] } diff --git a/server.py b/server.py index 18fa263..244fa53 100644 --- a/server.py +++ b/server.py @@ -104,8 +104,6 @@ class fuwuqi(SimpleHTTPRequestHandler): # C2S collection_append(username, 'outbox', activity) # Clients responsible for addressing activity - if type(activity['to']) is not list: - activity['to'] = [activity['to']] for to in activity['to']: if 'followers' in to or to == 'https://www.w3.org/ns/activitystreams#Public': with open(f'users/{username}.followers') as f: diff --git a/users/test.jsonld b/users/test.jsonld index a5e58d5..d412cd8 100644 --- a/users/test.jsonld +++ b/users/test.jsonld @@ -3,8 +3,8 @@ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1" ], - "id": "https://0.exozy.me/users/test.jsonld", "type": "Person", + "id": "https://0.exozy.me/users/test.jsonld", "preferredUsername": "test", "name": "Billiam Wender", "summary": "idk",