Skip to content

Commit

Permalink
Relay GTL patch
Browse files Browse the repository at this point in the history
  • Loading branch information
yunochi authored and jbblily committed Jun 7, 2024
1 parent c542820 commit e52b40c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,15 @@ export class ApInboxService {

const relays = await this.relayService.getAcceptedRelays();
const fromRelay = !!actor.inbox && relays.map(r => r.inbox).includes(actor.inbox);
const targetUri = getApId(activity.object);

const unlock = await this.appLockService.getApLock(uri);

try {
// 既に同じURIを持つものが登録されていないかチェック
const exist = await this.apNoteService.fetchNote(fromRelay ? targetUri : uri);
if (exist) {
this.logger.info(`Skip existing Note announce (fromRelay: ${fromRelay}, uri:${ fromRelay ? targetUri : uri})`);
return;
}

Expand All @@ -329,7 +331,7 @@ export class ApInboxService {
}

if (fromRelay) {
const noteObj = await this.noteEntityService.pack(renote);
const noteObj = await this.noteEntityService.pack(renote, null, { skipHide: true });
this.globalEventService.publishNotesStream(noteObj);
return;
}
Expand Down

0 comments on commit e52b40c

Please sign in to comment.