Skip to content

Commit

Permalink
Fix: Outboxから投稿を所得する際にタイムラインに投稿が流れないように (#348)
Browse files Browse the repository at this point in the history
Co-authored-by: Pen <[email protected]>
  • Loading branch information
penginn-net and Pen authored Aug 20, 2024
1 parent bf0577c commit efe479f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
-

### Server
- Fix: Outboxから投稿を所得する際にタイムラインに投稿が流れないように
- Fix: 翻訳にdeepl以外を利用していると翻訳できない問題を修正 [#355](https://github.com/yojo-art/cherrypick/pull/355)

### Misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ export class ApOutboxFetchService implements OnModuleInit {
if (isPost(target)) {
if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(targetUri))) continue;
try {
const renote = await this.apNoteService.resolveNote(targetUri);
if (renote == null) {
this.apLoggerService.logger.info('announce target is null');
continue;
let renote = await this.apNoteService.fetchNote(targetUri);
if (renote === null) {
renote = await this.apNoteService.createNote(targetUri, undefined, true);
if (renote === null) {
this.apLoggerService.logger.info('announce target is null');
continue;
}
}
this.logger.info(`Creating the (Re)Note: ${uri}`);

Expand All @@ -165,7 +168,7 @@ export class ApOutboxFetchService implements OnModuleInit {
visibility: activityAudience.visibility,
visibleUsers: activityAudience.visibleUsers,
uri,
});
}, true );
created++;
continue;
} catch (err) {
Expand All @@ -190,7 +193,7 @@ export class ApOutboxFetchService implements OnModuleInit {
if (local) {
continue;
}
await this.apNoteService.createNote(id);
await this.apNoteService.createNote(id, undefined, true);
created++;
} else {
this.apLoggerService.logger.warn('Outbox activity type is not announce or create-note (type:' + activity.type + ')' );
Expand Down

0 comments on commit efe479f

Please sign in to comment.