Skip to content

Commit

Permalink
Fixed usernames in Following list
Browse files Browse the repository at this point in the history
This is a temporary solution whilst we only support Ghost2Ghost
  • Loading branch information
allouis committed May 15, 2024
1 parent df1774d commit e833f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ghost/ghost/src/core/activitypub/actor.entity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
});

Expand Down
5 changes: 4 additions & 1 deletion ghost/ghost/src/core/activitypub/actor.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
});
}
}

Expand Down

0 comments on commit e833f20

Please sign in to comment.