Fixed usernames in Following list

This is a temporary solution whilst we only support Ghost2Ghost
This commit is contained in:
Fabien O'Carroll 2024-05-15 13:13:25 +07:00 committed by Fabien 'egg' O'Carroll
parent df1774d8e9
commit ddd803e1da
2 changed files with 5 additions and 1 deletions

View File

@ -175,6 +175,7 @@ describe('Actor', function () {
await actor.postToInbox(activity);
assert(actor.following.find(follower => follower.id.href === newFollower.href));
assert(actor.following.find(follower => follower.username === '@index@activitypub.server'));
});
});

View File

@ -69,7 +69,10 @@ export class Actor extends Entity<ActorData> {
}
if (activity.type === 'Accept') {
// TODO: Check that the Accept is for a real Follow activity
this.attr.following.push(activity.getObject());
this.attr.following.push({
id: activity.actorId,
username: `@index@${activity.actorId.hostname}`
});
}
}