upd: make new posts be marked as NSFW if instance is marked as NSFW

Closes #226
This commit is contained in:
Marie 2023-12-21 23:15:03 +01:00
parent 9c6a7aed98
commit 4ca3c05487

View file

@ -368,6 +368,14 @@ export class NoteCreateService implements OnApplicationShutdown {
}
}
if (user.host && !data.cw) {
await this.federatedInstanceService.fetch(user.host).then(async i => {
if (i.isNSFW) {
data.cw = 'Instance is marked as NSFW';
}
});
}
const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
setImmediate('post created', { signal: this.#shutdownController.signal }).then(