Merge branch 'markjh/room_tags' into markjh/client_config
Conflicts: api/client-server/v1/rooms.yaml api/client-server/v1/sync.yaml api/client-server/v2_alpha/sync.yaml specification/targets.yaml
This commit is contained in:
commit
24c4b8b095
5 changed files with 30 additions and 11 deletions
|
@ -312,9 +312,9 @@ paths:
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"visibility": "private",
|
"visibility": "private",
|
||||||
"private_user_data": [{
|
"account_data": [{
|
||||||
"type": "m.tag",
|
"type": "m.tag",
|
||||||
"content": {"tags": {"work": {"order": 1}}}
|
"content": {"tags": {"work": {"order": "1"}}}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
schema:
|
schema:
|
||||||
|
@ -375,7 +375,7 @@ paths:
|
||||||
description: |-
|
description: |-
|
||||||
Whether this room is visible to the ``/publicRooms`` API
|
Whether this room is visible to the ``/publicRooms`` API
|
||||||
or not."
|
or not."
|
||||||
private_user_data:
|
account_data:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The private data that this user has attached to this room.
|
The private data that this user has attached to this room.
|
||||||
|
|
|
@ -254,7 +254,7 @@ paths:
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"visibility": "private",
|
"visibility": "private",
|
||||||
"private_user_data": [
|
"account_data": [
|
||||||
{
|
{
|
||||||
"type": "m.tag",
|
"type": "m.tag",
|
||||||
"content": {"tags": {"work": {"order": 1}}}
|
"content": {"tags": {"work": {"order": 1}}}
|
||||||
|
@ -352,7 +352,7 @@ paths:
|
||||||
description: |-
|
description: |-
|
||||||
Whether this room is visible to the ``/publicRooms`` API
|
Whether this room is visible to the ``/publicRooms`` API
|
||||||
or not."
|
or not."
|
||||||
private_user_data:
|
account_data:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The private data that this user has attached to
|
The private data that this user has attached to
|
||||||
|
|
|
@ -139,7 +139,7 @@ paths:
|
||||||
e.g. typing.
|
e.g. typing.
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: "definitions/event_batch.json"
|
- $ref: "definitions/event_batch.json"
|
||||||
private_user_data:
|
account_data:
|
||||||
title: Private User Data
|
title: Private User Data
|
||||||
type: object
|
type: object
|
||||||
description: |-
|
description: |-
|
||||||
|
@ -297,7 +297,7 @@ paths:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"private_user_data": {
|
"account_data": {
|
||||||
"events": [
|
"events": [
|
||||||
{
|
{
|
||||||
"type": "m.tags",
|
"type": "m.tags",
|
||||||
|
|
|
@ -55,7 +55,7 @@ paths:
|
||||||
application/json: |-
|
application/json: |-
|
||||||
{
|
{
|
||||||
"tags": {
|
"tags": {
|
||||||
"work": {"order": 1},
|
"work": {"order": "1"},
|
||||||
"pinned": {}
|
"pinned": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
example: |-
|
example: |-
|
||||||
{"order": 1}
|
{"order": "1"}
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -11,16 +11,35 @@ Events
|
||||||
------
|
------
|
||||||
|
|
||||||
The tags on a room are received as single ``m.tag`` event in the
|
The tags on a room are received as single ``m.tag`` event in the
|
||||||
``private_user_data`` section of a room in a v2 /sync.
|
``account_data`` section of a room in a v2 /sync.
|
||||||
|
|
||||||
The ``m.tag`` can also be received in a v1 /events response or in the
|
The ``m.tag`` can also be received in a v1 /events response or in the
|
||||||
``private_user_data`` section of a room in v1 /initialSync. ``m.tag``
|
``account_data`` section of a room in v1 /initialSync. ``m.tag``
|
||||||
events appearing in v1 /events will have a ``room_id`` with the room
|
events appearing in v1 /events will have a ``room_id`` with the room
|
||||||
the tags are for.
|
the tags are for.
|
||||||
|
|
||||||
Each tag has an associated JSON object with information about the tag, e.g how
|
Each tag has an associated JSON object with information about the tag, e.g how
|
||||||
to order the rooms with a given tag.
|
to order the rooms with a given tag.
|
||||||
|
|
||||||
|
Ordering information is given under the ``order`` key as a string. The string
|
||||||
|
are compared lexicographically by unicode codepoint to determine which should
|
||||||
|
displayed first. So a room with a tag with an ``order`` key of ``"apples"``
|
||||||
|
would appear before a room with a tag with an ``order`` key of ``"oranges"``.
|
||||||
|
If a room has a tag without an ``order`` key then it should appear after the
|
||||||
|
rooms with that tag that have an ``order`` key.
|
||||||
|
|
||||||
|
The name of a tag MUST not exceed 255 bytes.
|
||||||
|
|
||||||
|
The name of a tag should be human readable. When displaying tags for a room a
|
||||||
|
client should display this human readable name. When adding a tag for a room
|
||||||
|
a client may offer a list to choose from that includes all the tags that the
|
||||||
|
user has previously set on any of their rooms.
|
||||||
|
|
||||||
|
Two special names are listed in the specification:
|
||||||
|
|
||||||
|
* ``m.favourite``
|
||||||
|
* ``m.lowpriority``
|
||||||
|
|
||||||
{{m_tag_event}}
|
{{m_tag_event}}
|
||||||
|
|
||||||
Client Behaviour
|
Client Behaviour
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue