Skip to content

Commit b3c2de2

Browse files
author
CDN
authored
fix(backend): fallback sharedInbox to null in ApPersonService (#14970)
1 parent cf1b7c7 commit b3c2de2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/backend/src/core/activitypub/models/ApPersonService.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export class ApPersonService implements OnModuleInit {
355355
usernameLower: person.preferredUsername?.toLowerCase(),
356356
host,
357357
inbox: person.inbox,
358-
sharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox,
358+
sharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox ?? null,
359359
followersUri: person.followers ? getApId(person.followers) : undefined,
360360
featured: person.featured ? getApId(person.featured) : undefined,
361361
uri: person.id,
@@ -521,7 +521,7 @@ export class ApPersonService implements OnModuleInit {
521521
const updates = {
522522
lastFetchedAt: new Date(),
523523
inbox: person.inbox,
524-
sharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox,
524+
sharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox ?? null,
525525
followersUri: person.followers ? getApId(person.followers) : undefined,
526526
featured: person.featured,
527527
emojis: emojiNames,
@@ -593,7 +593,7 @@ export class ApPersonService implements OnModuleInit {
593593
// 該当ユーザーが既にフォロワーになっていた場合はFollowingもアップデートする
594594
await this.followingsRepository.update(
595595
{ followerId: exist.id },
596-
{ followerSharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox },
596+
{ followerSharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox ?? null },
597597
);
598598

599599
await this.updateFeatured(exist.id, resolver).catch(err => this.logger.error(err));

0 commit comments

Comments
 (0)