Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the "sensitive" flag for posts #14162

Merged
merged 1 commit into from
May 16, 2024
Merged

Conversation

annando
Copy link
Collaborator

@annando annando commented May 15, 2024

Posts on for example Mastodon can be marked as "sensitive" in different ways. One is when a "content warning" is entered, but there are other ways as well, for example you can define your post as being "sensitive" in the Mastodon API without providing any data for the "spoiler_text" field: https://docs.joinmastodon.org/methods/statuses/#form-data-parameters

This field is now respected, when we display posts.

With this change we don't need to blur any pictures any more, when the post is set to sensitive:

When viewed:
image

When expanded:
image

@annando annando changed the title Respect the "sensitive" flag for summaries Respect the "sensitive" flag for posts May 15, 2024
@annando annando force-pushed the sensitive branch 2 times, most recently from e32376e to 29caa56 Compare May 15, 2024 11:38
Copy link
Collaborator

@MrPetovan MrPetovan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we keep both system.enable_cw and system.display_sensitive?

@@ -3440,8 +3439,8 @@ public static function prepareBody(array &$item, bool $attach = false, bool $is_
$filter_reasons[] = DI::l10n()->t('Content from %s is collapsed', $item['author-name']);
}

if (!empty($item['content-warning']) && (!$uid || !DI::pConfig()->get($uid, 'system', 'disable_cw', false))) {
$filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']);
if ($item['sensitive'] && (!$uid || !DI::pConfig()->get($uid, 'system', 'disable_cw', false))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quid of the system. display_sensitive pconfig key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@MrPetovan MrPetovan added this to the 2024.06 milestone May 15, 2024
@annando
Copy link
Collaborator Author

annando commented May 15, 2024

What should the other setting now control?

@MrPetovan
Copy link
Collaborator

  • system.enable_cw: Collapses posts with a summary
  • system.display_sensitive: Doesn't collapse sensitive posts

@annando
Copy link
Collaborator Author

annando commented May 15, 2024

There would be a third option as well: Collapse posts that marked as sensitive and that contain media. I would favour for possible a later PR introducing a new option that only collapses sensitive post when they contain media or a summary.

@MrPetovan
Copy link
Collaborator

You want a third option but you reduced the options to one in this PR, how about you leave the two current options for now until you introduce the third?

@annando
Copy link
Collaborator Author

annando commented May 16, 2024

display_sensitive was about blurring the images. I've removed the blurring. So that option doesn't make sense anymore. But I also wanted to simplify it for now, and then get some experience and feedback from the users, so that we can then find out what settings do make sense.

@MrPetovan MrPetovan merged commit c81ee0d into friendica:develop May 16, 2024
11 checks passed
@annando annando deleted the sensitive branch May 16, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants