Implement showing and sending media spoilers #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For sending, there is a checkbox during file upload asking whether to send as a spoiler. It applies to both "upload" and "upload all".
For showing, we piggyback off the existing hidden images implementation, fixing it to actually function correctly and be clickable. It works for m.image and m.video events. I have not tried using it when the base event is an extensible event.
Both of these use the
town.robin.msc3725.content_warning
(later,m.content_warning
) event type as per MSC3725.The previous hidden images implementation would PERMANENTLY remember an image as "should be shown" after it has been clicked once. I removed this behaviour, since the status quo on other apps of forgetting the state after you click to another room seems fairly natural. And it gives you a natural way out if you regret clicking.
If merged upstream, this could fix element-hq/element-web#18061 and vector-im/element-web#18062.