From a3f006353cd79636235a918d9788c7646b7e6f3c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 3 Mar 2018 12:40:41 -0700 Subject: [PATCH 1/2] Tag ordering is defined as a number between 0 and 1, not strings Signed-off-by: Travis Ralston --- event-schemas/examples/m.tag | 2 +- specification/modules/tags.rst | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/event-schemas/examples/m.tag b/event-schemas/examples/m.tag index 00e81060..53dbc921 100644 --- a/event-schemas/examples/m.tag +++ b/event-schemas/examples/m.tag @@ -2,7 +2,7 @@ "type": "m.tag", "content": { "tags": { - "work": {"order": 1} + "u.work": {"order": 1} } } } diff --git a/specification/modules/tags.rst b/specification/modules/tags.rst index 31b3b711..0187d791 100644 --- a/specification/modules/tags.rst +++ b/specification/modules/tags.rst @@ -35,12 +35,11 @@ the tags are for. Each tag has an associated JSON object with information about the tag, e.g how 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. +Ordering information is given under teh ``order`` key as a number between 0 and +1. The numbers are compared such that 0 is displayed first. Therefore a room +with an ``order`` of ``0.2`` would be displayed before a room with an ``order`` +of ``0.7``. 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. From c5738b87c0899bc5cd8e7d88def8983aa5666ede Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 3 Mar 2018 12:45:19 -0700 Subject: [PATCH 2/2] Add changelog entry for m.tag ordering Signed-off-by: Travis Ralston --- changelogs/client_server.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelogs/client_server.rst b/changelogs/client_server.rst index d86aeb63..7ac32e4a 100644 --- a/changelogs/client_server.rst +++ b/changelogs/client_server.rst @@ -19,6 +19,8 @@ Unreleased changes (`#1106 `_). - Clarify default values for some fields on the /search API (`#1109 `_). + - Clarify that ``m.tag`` ordering is done with numbers, not strings + (`#1139 `_). - Changes to the API which will be backwards-compatible for clients: