alphapapa / alphapapa/ement.el
Feature request: Spoiler messages
- Langage dominant
- Emacs Lisp
- Étoiles
- 604
- Forks
- 54
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I came across this in Element today, where the text was fuzzed until clicked on. I was surprised to learn that it's actually in the spec ([Spoiler message](https://spec.matrix.org/v1.7/client-server-api/#spoiler-messages)) as of 1.1.
I'm not entirely sure how this could be implemented. Appearance seems relatively easy, but I can imagine it being hard to get the info out of `shr`. Maybe just detecting the data-mx-spoiler string and making the whole thing a spoiler in the worst case. I guess you'd also need to add another message action to reveal a spoiler.
A syntax for marking spoilers may be trickier. I don't think there's a way to do anything like it in org. Element implements it for a whole message with a preceding `/spoiler`, but no way to mark parts of messages even though the spec allows it. There's some discussion of various formats at https://github.com/vector-im/element-meta/discussions/870
Here's an example of a message containing a spoiler (with the actual spoiler removed even though it's not much of a spoiler without context):
```elisp
((:id . "$RA3p_uXa0E0Qe8I0-QBqofW7H8Jfsfi-_P9t__wsKsw")
(:sender . "@zhaofeng:zhaofeng.li")
(:content
(body . "[Spoiler](spoilered text here)")
(format . "org.matrix.custom.html")
(formatted_body . "spoilered text here")
(msgtype . "m.text"))
(:origin-server-ts . 1685570405315)
(:type . "m.room.message")
(:state-key)
(:unsigned)
(:receipts)
(:local))
```
Even if it takes longer to figure out how to send them, I think it's valuable to implement spoiler display. People using clients that support them could reasonably expect that the text they're sending is hidden to others without opt-in.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.