Skip to content
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

Add a table to show how changes in membership should be interpreted #2056

Merged
merged 2 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/2056.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify how to interpret changes of ``membership`` over time.
23 changes: 23 additions & 0 deletions event-schemas/schema/m.room.member
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ description: |-
This event may also include an ``invite_room_state`` key inside the event's ``unsigned`` data.
If present, this contains an array of ``StrippedState`` Events. These events provide information
on a subset of state events such as the room name.

The user for which a membership applies is represented by the ``state_key``. Under some conditions,
the ``sender`` and ``state_key`` may not match - this may be interpreted as the ``sender`` affecting
the membership state of the ``state_key`` user.

The ``membership`` for a given user can change over time. The table below represents the various changes
over time and how clients and servers must interpret those changes. Previous membership can be retrieved
from the ``prev_content`` object on an event. If not present, the user's previous membership must be assumed
as ``leave``.

.. TODO: Improve how this table is written? We use a csv-table to get around vertical header restrictions.

.. csv-table::
:header-rows: 1
:stub-columns: 1

"","to ``invite``","to ``join``","to ``leave``","to ``ban``","to ``knock``"
"from ``invite``","No change.","User joined the room.","If the ``state_key`` is the same as the ``sender``, the user rejected the invite. Otherwise, the ``state_key`` user had their invite revoked.","User was banned.","Not implemented."
"from ``join``","Must never happen.","``displayname`` or ``avatar_url`` changed.","If the ``state_key`` is the same as the ``sender``, the user left. Otherwise, the ``state_key`` user was kicked.","User was kicked and banned.","Not implemented."
KitsuneRal marked this conversation as resolved.
Show resolved Hide resolved
"from ``leave``","New invitation sent.","User joined.","No change.","User was banned.","Not implemented."
"from ``ban``","Must never happen.","Must never happen.","User was unbanned.","No change.","Not implemented."
"from ``knock``","Not implemented.","Not implemented.","Not implemented.","Not implemented.","Not implemented."

properties:
content:
properties:
Expand Down
4 changes: 4 additions & 0 deletions scripts/css/tables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Column with header cells */
table.docutils tbody th.stub {
background: #eeeeee;
}