mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-04-13 09:44:40 +00:00
hide sensitive content from Discord previews
This commit is contained in:
parent
36dee5ff20
commit
ebc3abea54
1 changed files with 6 additions and 0 deletions
|
@ -32,6 +32,12 @@ export class ApiStatusMastodon {
|
|||
const data = await client.getStatus(_request.params.id);
|
||||
const response = await this.mastoConverters.convertStatus(data.data, me);
|
||||
|
||||
// Fixup - Discord ignores CWs and renders the entire post.
|
||||
if (response.sensitive && _request.headers['user-agent']?.match(/\bDiscordbot\//)) {
|
||||
response.content = '(preview disabled for sensitive content)';
|
||||
response.media_attachments = [];
|
||||
}
|
||||
|
||||
reply.send(response);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue