matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
197 stars 97 forks source link

m.spoilers and m.punchline msg types (SPEC-311) #141

Open matrixbot opened 8 years ago

matrixbot commented 8 years ago

Submitted by @​matthew:matrix.org or something, would be kinda fun for telling clients to hide message bodies where appropriate. more seriously, m.nsfw too

(Imported from https://matrix.org/jira/browse/SPEC-311)

ara4n commented 8 years ago

related to https://github.com/matrix-org/matrix-doc/issues/548

richvdh commented 7 years ago

we probably need to generalise this beyond rigid classifications of "spoilers" vs "punchlines" vs "nsfw" to let the sender give an indication of what is hidden.

SoniEx2 commented 7 years ago

I want:

{
  "message": ["message 1", "message 2"]
  "hidden": ["hidden 1", "hidden 2"]
}

And it should look like [message 1][hidden 1][message 2][hidden 2] but with the hiddens actually hidden. hidden may be one smaller than message but otherwise needs to be the same length.

e.g.

"hello [hidden] world"

message: ['hello', 'world'] hidden: ['cruel']

"[hidden] test"

message: ['', 'test'] hidden: ['a']

This is highly flexible and closely matches IRC CWs, making it possible to bridge them.