-
Notifications
You must be signed in to change notification settings - Fork 401
MSC3955: Extensible Events - Automated event mixin (notices) #3955
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
Open
turt2live
wants to merge
2
commits into
main
Choose a base branch
from
travis/msc/extev/notices
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# MSC3955: Extensible Events - Automated event mixin (notices) | ||
|
||
[MSC1767](https://github.com/matrix-org/matrix-doc/pull/1767) describes Extensible Events in detail, | ||
though deliberately does not include schemas for some messaging types. This MSC covers a replacement | ||
for the `m.notice` `msgtype` specifically. | ||
|
||
*Rationale*: Splitting the MSCs down into individual parts makes it easier to implement and review in | ||
stages without blocking other pieces of the overall idea. For example, an issue with the way notices | ||
are represented should not block the overall schema from going through. | ||
|
||
## Proposal | ||
|
||
As mentioned in MSC1767, it is desirable to represent more than just text events as "automated" or | ||
sent by a bot. Currently, [`m.notice`](https://spec.matrix.org/v1.5/client-server-api/#mnotice) is | ||
defined only as a `msgtype` on `m.room.message` events, thus only allowing bots (and other automated | ||
clients) to send plain text. To open this functionality up to any event, we define an `m.automated` | ||
*mixin* content block that can be applied to any event: | ||
|
||
```json5 | ||
{ | ||
// irrelevant fields not shown | ||
"type": "m.emote", | ||
"content": { | ||
"m.text": [{"body": "says hi"}], | ||
"m.automated": true | ||
} | ||
} | ||
``` | ||
|
||
`m.automated`'s value is a boolean, defaulting to `false` when not present, to denote if an event is | ||
automated. Note that other value types should be treated as `false` (ie: not present). | ||
|
||
When an event is flagged as automated, the client should render that event differently compared to | ||
normal. For example, reducing the opacity of the event. | ||
|
||
If the client does not believe there is a material difference between automated and non-automated for | ||
a particular event type, it is not required to render the event differently. Such an example might be | ||
a poll: the practical difference from a user perspective of a bot sending a poll versus a user isn't | ||
generally important, and so the client may decide to forgo opacifying the event. This is also the | ||
default behaviour if the client does not understand the mixin: the event will be rendered normally, | ||
with the client ultimately ignoring the `m.automated` mixin. | ||
|
||
## Potential issues | ||
|
||
No significant issues known. | ||
|
||
## Alternatives | ||
|
||
No significant alternatives known. | ||
|
||
## Security considerations | ||
|
||
No specific considerations are required for this proposal. | ||
|
||
## Unstable prefix | ||
|
||
While this MSC is not considered stable, implementations should use `org.matrix.msc1767.*` as a prefix in | ||
place of `m.*` throughout this proposal. Note that this uses the namespace of the parent MSC rather than | ||
the namespace of this MSC - this is deliberate. | ||
|
||
Note that extensible events should only be used in an appropriate room version as well. |
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.
Uh oh!
There was an error while loading. Please reload this page.