element-hq / element-meta

Shared/meta documentation and project artefacts for Element clients
75 stars 12 forks source link

UX for creating moderation rooms #1666

Open Yoric opened 3 years ago

Yoric commented 3 years ago

Opening this issue to document the implementation of the part of MSC3215 that deals with creating new rooms/marking a room as a Moderation Room/marking a room as moderated by a Moderation Room.

Yoric commented 3 years ago

Flow 1: Creating a new room

To create a new Community Room CR

  1. Check if there is a well-known moderator bot for the server
    • GET /.well-known/matrix/client
    • Check for a key org.matrix.msc3215.room.moderation.default_moderator_user_id.
  2. We should have a checkbox This room supports moderation.
  3. When the checkbox is ticked, the user may either pick:
    • Create a new moderation room with default settings (only available if org.matrix.msc3215.room.moderation.default_moderator_user_id was defined above);
    • Join an existing moderation room (insert room id or alias - the user must already be a member of that room).
  4. If the user has picked "Create a new moderation room"
    1. Create a new empty room MR;
    2. Create a new empty room CR;
    3. Give it a display name such as "Foo - Moderation Room";
    4. Insert into MR state events
      // template for other community rooms
      // type: org.matrix.msc3215.room.moderation.moderator_of
      // key: ""
      {
      "user_id": // The value of `org.matrix.msc3215.room.moderation.default_moderator_user_id` above
      }

      and

      // attach to CR
      // type: org.matrix.msc3215.room.moderation.moderator_of
      // key: CR's roomId
      {
      "user_id": // The value of `org.matrix.msc3215.room.moderation.default_moderator_user_id` above
      }
    5. Insert into CR state events
      // type: org.matrix.msc3215.room.moderation.moderated_by
      // key: org.matrix.msc3215.room.moderation.moderated_by
      {
      "room_id": // MR's roomId
      "user_id":  // The value of `org.matrix.msc3215.room.moderation.default_moderator_user_id` above
      }
    6. Proceed as usual.
  5. If the user has picked "Join a moderation room" MR
    1. Fetch state event SE ("org.matrix.msc3215.room.moderation.moderator_of", "") from MR.
    2. If SE is empty, fail.
    3. Create empty room CR
    4. Insert into MR state event
      
      // type: org.matrix.msc3215.room.moderation.moderator_of
      // key: CR's roomId
      {
      "user_id": // SE.user_id
      }
    5. Insert into CR state event
      // type: org.matrix.msc3215.room.moderation.moderated_by
      // key: org.matrix.msc3215.room.moderation.moderated_by
      {
      "room_id": // MR's roomId
      "user_id":  // SE.user_id
      }
    6. Proceed as usual.

How can we make this flow nicer?

Yoric commented 3 years ago

Flow 2: Marking an existing room as supporting moderation.

In the room setting:

  1. Check if there is a well-known moderator bot for the server
    • GET /.well-known/matrix/client
    • Check for a key org.matrix.msc3215.room.moderation.default_moderator_user_id.
  2. We should have a checkbox "This room supports moderation". // ...

Well, this is pretty much the same flow as above except we don't need to create CR.

Yoric commented 3 years ago

Flow 3: Marking an existing room as a moderation room

In the room setting:

  1. Check if there is a well-known moderator bot for the server
    • GET /.well-known/matrix/client
    • Check for a key org.matrix.msc3215.room.moderation.default_moderator_user_id.
  2. We should have a checkbox "Use this room as a moderation room".
  3. When the checkbox is checked
    • Show a field Abuse Report Bot: (pre-filled with org.matrix.msc3215.room.moderation.default_moderator_user_id as above).
  4. Insert into MR state events
    // template for other community rooms
    // type: org.matrix.msc3215.room.moderation.moderator_of
    // key: ""
    {
      "user_id": // The value picked in Abuse Report Bot
    }