Merge tag '2023.12.0-beta.6' into merge-upstream

This commit is contained in:
riku6460 2023-12-21 11:56:34 +09:00
commit b3de794bdd
No known key found for this signature in database
GPG key ID: 27414FA27DB94CF6
251 changed files with 2328 additions and 1176 deletions

View file

@ -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);
@ -623,7 +623,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 {
return false;
}
@bindThis
private isQuote(note: Option): boolean {
return !!note.text || !!note.cw || !!note.files || !!note.poll;
}
@bindThis
private incRenoteCount(renote: MiNote) {
this.notesRepository.createQueryBuilder().update()
@ -796,7 +801,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);