turt2live / matrix-bot-sdk

TypeScript/JavaScript SDK for Matrix bots
MIT License
199 stars 69 forks source link

Handle pre-shared invite keys #271

Closed AndrewFerr closed 1 year ago

AndrewFerr commented 1 year ago

Signed-off-by: Andrew Ferrazzutti andrewf@element.io

Checklist

AndrewFerr commented 1 year ago

the other thing I'm not sure on is whether this is actually recommended by the spec/rust-sdk - it doesn't appear to come up in documentation, though I'm willing to admit I might be blind.

FWIW this is the behaviour Element Web uses. If you've invited a user with an encryption-enabled device to an encrypted room, EW will send the room key to that user (via a to-device message) even before they've joined the room. In fact, it sends the key even before you post a message -- it sends it as soon as you starting typing a message!