From 5e1e809962bc81c2f8f76de5cb813e3c74e85eb0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 8 Jan 2024 14:46:43 -0500 Subject: [PATCH] feat: send name property in getActor response --- src/activitypub/index.js | 1 + src/controllers/activitypub/index.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 721cb52159..368f249319 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -89,6 +89,7 @@ ActivityPub.mockProfile = async (actors, callerUid = 0) => { uid, username: `${preferredUsername}@${hostname}`, userslug: `${preferredUsername}@${hostname}`, + displayname: name, fullname: name, joindate: new Date(published).getTime(), picture, diff --git a/src/controllers/activitypub/index.js b/src/controllers/activitypub/index.js index 4477efeb38..201216b365 100644 --- a/src/controllers/activitypub/index.js +++ b/src/controllers/activitypub/index.js @@ -15,7 +15,7 @@ Controller.getActor = async (req, res) => { // todo: view:users priv gate const { userslug } = req.params; const { uid } = res.locals; - const { username, aboutme, picture, 'cover:url': cover } = await user.getUserData(uid); + const { username, displayname: name, aboutme, picture, 'cover:url': cover } = await user.getUserData(uid); const publicKey = await activitypub.getPublicKey(uid); res.status(200).json({ @@ -31,6 +31,7 @@ Controller.getActor = async (req, res) => { outbox: `${nconf.get('url')}/user/${userslug}/outbox`, type: 'Person', + name, preferredUsername: username, summary: aboutme, icon: picture ? `${nconf.get('url')}${picture}` : null,