alphapapa / alphapapa/ement.el

Feature request: Spoiler messages

Aperta
#167 13 commenti 0 reazioni 0 assegnatari Vedi su GitHub
compatibility enhancement good first issue help wanted
Lingua principale
Emacs Lisp
Stelle
604
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.