feat: added mocks.actor and Update(Person) activity on profile update

This commit is contained in:
Julian Lam
2024-01-24 20:10:22 -05:00
parent f51bbe91e7
commit 8453b83e9e
4 changed files with 53 additions and 28 deletions

View File

@@ -104,3 +104,19 @@ activitypubApi.create.post = async (caller, { post }) => {
await activitypub.send(caller.uid, Array.from(targets), payload);
};
activitypubApi.update = {};
activitypubApi.update.profile = async (caller, { uid }) => {
const [object, followers] = await Promise.all([
activitypub.mocks.actor(uid),
db.getSortedSetMembers(`followersRemote:${caller.uid}`),
]);
await activitypub.send(caller.uid, followers, {
type: 'Update',
to: [activitypub._constants.publicAddress],
cc: [],
object,
});
};