matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
177 stars 94 forks source link

Invites need to convey a better summary of the room they describe. #380

Open ara4n opened 5 years ago

ara4n commented 5 years ago

Currently we allow a subset of state events through in an invite.

This isn't enough to correctly calculate the name & avatar of a room based on https://github.com/matrix-org/matrix-doc/issues/688.

Either we need to somehow include enough state in the invite (e.g. a hypothetical m.room.summary event, plus a bunch of m.room.members for the heroes), or we need to change things so that invitees can peek into the live DAG of an invited room and draw their own conclusions.

If we supported invitees peeking into the live DAG of an invited room this would also solve things like the problems around supporting encryption for invited users before they join a room - c.f. https://github.com/vector-im/riot-web/issues/2713#issuecomment-402989021

bwindels commented 5 years ago

An alternative could be that the server includes a room summary under the same conditions as for joined rooms (no name or avatar set...), and if the summary needs to have heroes, augment the invite_state with the member events for the heroes.

Allowing invitees to have access to the DAG might be useful, but I think we'd still need a room summary, because you wouldn't want to have to load all the members to give an accurate name and avatar for a room you got invited to.

ara4n commented 5 years ago

An alternative could be that the server includes a room summary under the same conditions as for joined rooms (no name or avatar set...), and if the summary needs to have heroes, augment the invite_state with the member events for the heroes.

Yup, this is what i was trying to suggest in the first option in the original comment:

Either we need to somehow include enough state in the invite (e.g. a hypothetical m.room.summary event, plus a bunch of m.room.members for the heroes)

ara4n commented 5 years ago

If we were allowing direct access to the DAG, then we'd get the room summary for free, i think, as it'd probably look like a joined room, so the same rules would apply for calculating the /sync details for it.