Skip to content
Open
65 changes: 65 additions & 0 deletions proposals/3784-using-room-type-of-m.policy-for-policy-rooms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# MSC3784 Using room type of m.policy for policy rooms
Comment thread
turt2live marked this conversation as resolved.
Copy link
Copy Markdown
Contributor Author

@FSG-Cat FSG-Cat Nov 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this thread to track Implementation status outside of the PR descript.

Implementation Tracking

Mjolnir as of da08432 and that commit is included in Release 1.6.0. Mjolnir implementation at time of writing only includes that it creates rooms for policy lists with the type.
Nheko in mtxclient has added initial support to recognise it in 4bd39bce. Further progres unknown at time of writing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Nheko use it besides just declaring the constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy Editing that utilises MSC3784 to aid in detecting if a room is a policy list is implemented in RMU. Version that implemented first is unknown but current Version as of writing relies on this as one of its 2 detection methods. It also supports legacy detection.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://mru.rory.gay/PolicyLists is the particular page in RMU that uses this MSC to find policy rooms. I'm not sure whether it has legacy detection enabled or not, but legacy detection here was implemented by checking for the Mjolnir shortcode state event. It does not show rooms that happen to have policy events, as querying /sync or /state for rooms is very expensive, especially compared to cherry picking 2 events.

(Oops, I still have to get rid of the "Create policy list" popup being there by default, which also uses the MSC's unstable type on room creation, additionally I've just uncovered a crash related to fetching room names... That's for the tomorrow pile).


## Introduction

This simple MSC aims to make it easier for machines and people alike to be made instantly aware if a
room is a policy list. To facilitate this this MSC recommends using the already established `type`
attribute to flag rooms as policy rooms. This builds upon the precedent set by Spaces and their
`"type": "m.space"`. Adopting this for Policy rooms allows all stakeholders to instantly know if its
a Policy room or not for rooms covered by this proposal.

For the purposes of this MSC policy lists can at times be called a policy room. This MSC does not intend
to change the name of the feature its just used to be very clear that we are talking about rooms with a
specific usecase.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated

## Proposal

This proposal is well quite simple. Allow for Policy rooms to be marked as such using the
`"type": "m.policy"`. The precedent for this comes from Spaces where they introduced this system in a
limited capacity. This proposal expands this system to help all stakeholders quickly identify
policy rooms in a machine compatible way that is computationally cheap. It has additional benefits like
allowing clients that are capable of editing policy to display editing tools for policy rooms when they
detect that a room is a policy room using this mechanic. For machine interaction with policy rooms this
proposal supplies a very fast way to tell if a room is definitively supposed to be a policy room or if
the user might have supplied a legacy room or typed in the wrong room ID / alias depending on how things
are configured.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To expand on this a bit, I really need something like this. Without this you run into a bootstrapping issue. Is this room supposed to be a policy room before the first policy is sent?

Without a room type you need to inspect the full room state to look for policy rules before you switch to the policy editor design. Slash commands can't warn the user properly that they are sending the rule into the wrong room.

So yes, I very much need this to provide a nice experience in my client. I can somewhat paper over it using account data, but it is not great. Everywhere we are told rooms are cheap. So far no rooms send policy rules into rooms you can send messages in. Most moderation tools even make it impossible to message in policy rooms, since that could possibly break the policy room when you actually need it to fight spam.

Thank you for writing this MSC!


Legacy rooms in this proposal are defined as all rooms that predate this proposal and they are free to upgrade
if they desire to but they are also free to stay on their current room version and not upgrade their
room to include a type event in the creation event. All stakeholders are expected to gracefully support
interacting with legacy rooms until a future proposal changes this recommendation.

The Author of this MSC believes that even with the problem of legacy rooms not being covered this MSC will
be useful in the future with more use of policy rooms.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated


## Potential issues

As is covered in the proposal section this MSC has the potential issue relating to Legacy rooms.
The Author of this MSC thinks its that its an acceptable trade-off.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated


## Alternatives

The alternative of using Peeking over fed to try to figure out if a room is a policy list has been
considered but considering that its currently considered at the time of writing to be a very in development
technology its deemed wholly unsuited for this application. The system this proposal recommends is the same
one that was used for spaces. Spaces have proven them self's in the real world and so has this system.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated

## Security considerations

None that the author is aware of at the time of writing due to the mostly informative nature of the data.
Due to that no client should trust that just because it says m.policy it is indeed a policy room the security
implications should be minimal.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated

## Unstable prefix

If you want to implement this MSC before its merged your free to use the unstable type of
`support.feline.policy.lists.msc.v1`.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated

After this MSC gets merged if a stakeholder has elected to remove its support for the unstable prefix if any
support existed or support never existed revert to Legacy room behavior for rooms that used the unstable prefix.
Comment thread
FSG-Cat marked this conversation as resolved.
Outdated

## Dependencies

The Author is not aware of any unstable MSC dependencies for this MSC.