-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spec reference relationships (#1206)
* Spec reference relationships MSC: matrix-org/matrix-spec-proposals#3267 * Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Edits per code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 @@ | ||
Add `m.reference` relations, as per [MSC3267](https://github.com/matrix-org/matrix-spec-proposals/pull/3267). |
This file contains 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
This file contains 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,55 @@ | ||
--- | ||
type: module | ||
--- | ||
|
||
### Reference relations | ||
|
||
{{% added-in v="1.4" %}} | ||
|
||
Generically referencing another event can be done with a `rel_type` of `m.reference` | ||
as a form of [relationship](#forming-relationships-between-events). There is no | ||
implied meaning behind the reference, and is usually context-dependent. One | ||
example is the [key verification framework](#key-verification-framework) which uses | ||
reference relations to associate distinct events with a specific verification attempt. | ||
|
||
{{% boxes/note %}} | ||
Clients which wish to use threads or replies are expected to use other relationship | ||
types than references. References are typically used to associate data rather than | ||
messages. | ||
{{% /boxes/note %}} | ||
|
||
#### Server behaviour | ||
|
||
##### Server-side aggregation of `m.reference` | ||
|
||
The aggregation format of `m.reference` relations consists of a single `chunk` property, | ||
which lists all the events which `m.reference` the event (the parent). Currently, | ||
only a single `event_id` field is present on the events in the `chunk`. | ||
|
||
An example `m.reference` would be: | ||
|
||
```json | ||
{ | ||
"content": { | ||
"m.relates_to": { | ||
"rel_type": "m.reference", | ||
"event_id": "$another_event" | ||
} | ||
// other content fields as required | ||
} | ||
// other fields as required by events | ||
} | ||
``` | ||
|
||
The [bundle](#aggregations) under `m.relations` would appear similar to the following: | ||
|
||
```json | ||
{ | ||
"m.reference": { | ||
"chunk": [ | ||
{ "event_id": "$one" }, | ||
{ "event_id": "$two" } | ||
] | ||
} | ||
} | ||
``` |
This file contains 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