summaryrefslogtreecommitdiffstats
path: root/users/views
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-15 18:30:30 -0700
committerAndrew Godwin2022-11-15 15:30:32 -0700
commit20e63023bb0d3c7e4cb36b91b73e79f51889cc90 (patch)
tree96c99139f03550e35902440cd321290bc47f8f0f /users/views
parent4aa92744aea6097ffb784ca7de6bd95cc599988d (diff)
downloadtakahe-20e63023bb0d3c7e4cb36b91b73e79f51889cc90.tar.gz
takahe-20e63023bb0d3c7e4cb36b91b73e79f51889cc90.tar.bz2
takahe-20e63023bb0d3c7e4cb36b91b73e79f51889cc90.zip
Get outbound likes/boosts and their undos working
Diffstat (limited to 'users/views')
-rw-r--r--users/views/activitypub.py27
1 files changed, 3 insertions, 24 deletions
diff --git a/users/views/activitypub.py b/users/views/activitypub.py
index 1a709ac..f1abb06 100644
--- a/users/views/activitypub.py
+++ b/users/views/activitypub.py
@@ -52,13 +52,13 @@ class Webfinger(View):
{
"subject": f"acct:{identity.handle}",
"aliases": [
- identity.urls.view_short.full(),
+ identity.view_url,
],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
- "href": identity.urls.view_short.full(),
+ "href": identity.view_url,
},
{
"rel": "self",
@@ -77,28 +77,7 @@ class Actor(View):
def get(self, request, handle):
identity = by_handle_or_404(self.request, handle)
- response = {
- "@context": [
- "https://www.w3.org/ns/activitystreams",
- "https://w3id.org/security/v1",
- ],
- "id": identity.actor_uri,
- "type": "Person",
- "inbox": identity.actor_uri + "inbox/",
- "preferredUsername": identity.username,
- "publicKey": {
- "id": identity.public_key_id,
- "owner": identity.actor_uri,
- "publicKeyPem": identity.public_key,
- },
- "published": identity.created.strftime("%Y-%m-%dT%H:%M:%SZ"),
- "url": identity.urls.view_short.full(),
- }
- if identity.name:
- response["name"] = identity.name
- if identity.summary:
- response["summary"] = identity.summary
- return JsonResponse(canonicalise(response, include_security=True))
+ return JsonResponse(canonicalise(identity.to_ap(), include_security=True))
@method_decorator(csrf_exempt, name="dispatch")