Skip to content

Commit

Permalink
fix: Local-only activity deliver to remote
Browse files Browse the repository at this point in the history
  • Loading branch information
ZerglingGo committed Jul 17, 2023
1 parent 9fc3e19 commit f07d5c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/backend/src/core/NoteCreateService.ts
Expand Up @@ -619,6 +619,12 @@ export class NoteCreateService implements OnApplicationShutdown {
if (this.userEntityService.isLocalUser(user)) {
(async () => {
const noteActivity = await this.renderNoteOrRenoteActivity(data, note);

// Skip deliver if local only notes
if (noteActivity === null) {
return;
}

const dm = this.apDeliverManagerService.createDeliverManager(user, noteActivity);

// メンションされたリモートユーザーに配送
Expand Down
Expand Up @@ -54,6 +54,9 @@ export class InboxProcessorService {
public async process(job: Bull.Job<InboxJobData>): Promise<string> {
const signature = job.data.signature; // HTTP-signature
const activity = job.data.activity;
if (activity === null) {
return 'Empty activity data';
}

//#region Log
const info = Object.assign({}, activity);
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/queue/types.ts
Expand Up @@ -18,7 +18,7 @@ export type DeliverJobData = {
};

export type InboxJobData = {
activity: IActivity;
activity: IActivity | null;
signature: httpSignature.IParsedSignature;
};

Expand Down

0 comments on commit f07d5c4

Please sign in to comment.