Skip to content

Commit 00b84dd

Browse files
committed
Clearer definition for m.asset and edge cases.
1 parent 70e408a commit 00b84dd

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

proposals/3488-location.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ would be the client's reponsibility to map them to values a particular library
4242
uses, if different. The client is also free to completely ignore it and decide
4343
the zoom level through other means.
4444

45-
```json
45+
```json5
4646
"m.location": {
4747
"uri": "geo:51.5008,0.1247;u=35",
4848
"description": "Our destination",
@@ -51,7 +51,23 @@ the zoom level through other means.
5151
```
5252

5353
In order to differentiate between user tracking and other objects we also
54-
introduce another subtype called `m.asset` to give the object a type and ID.
54+
introduce a new subtype called `m.asset` to give the object a type and ID.
55+
56+
`m.asset` defines a generic asset that can be used for location tracking
57+
but also in other places like inventories, geofencing, check-ing-checkout etc.
58+
It should contain a mandatory namespaced `type` key defining what particular
59+
asset is being referred to.
60+
For the purposes of user location tracking `m.self` should be used in order to
61+
avoid duplicating the mxid.
62+
63+
If `m.asset` is missing from the location's content the client should render it
64+
as `m.self` as that will be the most common use case.
65+
Otherwise, if it's not missing but the type is invalid or unkown the client
66+
should attempt to render it as a generic location.
67+
Clients should be able to distinguish between `m.self` and explicit assets for
68+
this feature to be correctly implemented as interpreting everything as `m.self`
69+
is unwanted.
70+
5571

5672
If sharing time-sensitive data, one would add another subtype (e.g. a
5773
hypothetical `m.ts` type) to spell out the exact time that the data in the
@@ -62,7 +78,7 @@ static location, suitable for "drop a pin on a map" style use cases.
6278

6379
Example for sharing a static location:
6480

65-
```json
81+
```json5
6682
{
6783
"type": "m.location",
6884
"content": {
@@ -71,7 +87,7 @@ Example for sharing a static location:
7187
"description": "Matthew's whereabouts",
7288
},
7389
"m.asset": {
74-
"type": "user" // the type of asset being tracked
90+
"type": "m.self" // the type of asset being tracked
7591
},
7692
"m.ts": 1636829458432,
7793
"m.text": "Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021"
@@ -89,7 +105,7 @@ in the `m.location` extensible event type from this MSC into the old-style
89105
relevant data. If both fields are present, clients that speak MSC3488 should
90106
favour the contents of the MSC3488 fields over the legacy `geo_uri` field.
91107

92-
```json
108+
```json5
93109
{
94110
"type": "m.room.message",
95111
"content": {
@@ -101,7 +117,7 @@ favour the contents of the MSC3488 fields over the legacy `geo_uri` field.
101117
"description": "Matthew's whereabouts",
102118
},
103119
"m.asset": {
104-
"type": "user" // the type of asset being tracked
120+
"type": "m.self" // the type of asset being tracked
105121
},
106122
"m.text": "Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021",
107123
"m.ts": 1636829458432,
@@ -124,7 +140,7 @@ support the concept of uncertainty, and is designed more for sharing map
124140
annotations than location sharing. It would look something like this if we
125141
used it:
126142

127-
```json
143+
```json5
128144
"m.geo": {
129145
"type": "Point",
130146
"coordinates": [30.0, 10.0]

0 commit comments

Comments
 (0)