mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 01:43:09 +02:00
upd: make new posts be marked as NSFW if instance is marked as NSFW
Closes #226
This commit is contained in:
parent
9c6a7aed98
commit
4ca3c05487
1 changed files with 8 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue