Skip to content

Automatically add to account_data "m.direct" direct rooms members #2672

@c10b10

Description

@c10b10

To create a direct message room we need to call

client.createRoom({ 
   is_direct: true, 
   invite: [userId], 
   visibility: "private" 
})

This creates the room, but as per the matrix spec:

Both the inviting client and the invitee’s client should record the fact that the room is a direct chat by storing an m.direct event in the account data using /user/<user_id>/account_data/.

As far as I can tell, this isn't done automatically by matrix-js-sdk.

Manual management is impossible for servers that configure auto-joining on invites. Without m.direct update, it's impossible to tell which rooms are DM rooms. This might mean that this is a Bug report rather than a Feature request.

Describe the solution you'd like

When a user joins a DM room (one that was created with the above options), matrix-js-sdk should make sure the m.direct account data is correctly set as per the matrix docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions