implement mandatory CW for notes (resolves #910)
This commit is contained in:
parent
6f8d831e09
commit
92750240eb
29 changed files with 305 additions and 11 deletions
|
|
@ -127,6 +127,7 @@ function generateDummyNote(override?: Partial<MiNote>): MiNote {
|
|||
renoteUserInstance: null,
|
||||
updatedAt: null,
|
||||
processErrors: [],
|
||||
mandatoryCW: null,
|
||||
...override,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -497,6 +497,9 @@ export class ApRendererService {
|
|||
let summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
|
||||
|
||||
// Apply mandatory CW, if applicable
|
||||
if (note.mandatoryCW) {
|
||||
summary = appendContentWarning(summary, note.mandatoryCW);
|
||||
}
|
||||
if (author.mandatoryCW) {
|
||||
summary = appendContentWarning(summary, author.mandatoryCW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -651,6 +651,7 @@ export class NoteEntityService implements OnModuleInit {
|
|||
user: packedUsers?.get(note.userId) ?? this.userEntityService.pack(note.user ?? note.userId, me),
|
||||
text: text,
|
||||
cw: note.cw,
|
||||
mandatoryCW: note.mandatoryCW,
|
||||
visibility: note.visibility,
|
||||
localOnly: note.localOnly,
|
||||
reactionAcceptance: note.reactionAcceptance,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue