diff options
| author | 1STEP621 <86859447+1STEP621@users.noreply.github.com> | 2023-12-18 19:49:19 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-18 19:49:19 +0900 |
| commit | f6ff3b1f1a7047a29337575c08849be99ac15a4b (patch) | |
| tree | cedbc8c26140dadb334c6970fa4b4a7a36105291 /packages/backend/src/core/NoteCreateService.ts | |
| parent | Enhance(frontend): Shift+Tabで前の補完候補が選択できるように ... (diff) | |
| download | sharkey-f6ff3b1f1a7047a29337575c08849be99ac15a4b.tar.gz sharkey-f6ff3b1f1a7047a29337575c08849be99ac15a4b.tar.bz2 sharkey-f6ff3b1f1a7047a29337575c08849be99ac15a4b.zip | |
Fix: Renoteの判定が間違っているのを修正 (#12706)
* RNと引用RNの判定が間違っているのを修正
* remove dump.rdb
* update CHANGELOG.md
* lint fix
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteCreateService.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 45dfbb87aa..9fe965b139 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -293,7 +293,7 @@ export class NoteCreateService implements OnApplicationShutdown { } // Check blocking - if (data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0)) { + if (data.renote && this.isQuote(data)) { if (data.renote.userHost === null) { if (data.renote.userId !== user.id) { const blocked = await this.userBlockingService.checkBlocked(data.renote.userId, user.id); @@ -622,7 +622,7 @@ export class NoteCreateService implements OnApplicationShutdown { // If it is renote if (data.renote) { - const type = data.text ? 'quote' : 'renote'; + const type = this.isQuote(data) ? 'quote' : 'renote'; // Notify if (data.renote.userHost === null) { @@ -730,6 +730,11 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis + private isQuote(note: Option): boolean { + return !!note.text || !!note.cw || !!note.files || !!note.poll; + } + + @bindThis private incRenoteCount(renote: MiNote) { this.notesRepository.createQueryBuilder().update() .set({ @@ -794,7 +799,7 @@ export class NoteCreateService implements OnApplicationShutdown { private async renderNoteOrRenoteActivity(data: Option, note: MiNote) { if (data.localOnly) return null; - const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0) + const content = data.renote && this.isQuote(data) ? this.apRendererService.renderAnnounce(data.renote.uri ? data.renote.uri : `${this.config.url}/notes/${data.renote.id}`, note) : this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, false), note); |