matrix-org / matrix-org/matrix-js-sdk
In the spirit of matrix-doc/specification/modules/guest_access.rst, Allow Guest to sendTyping + sendReceipt + sendMessage
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
Is your feature request related to a problem? Please describe.
Yes. The problem is that if we want to use matrix-js-sdk to build chat/RTC applications with a more guest-centric design it is difficult unless we create an user account with password in the background for them. (There is a whole thread on this: https://github.com/vector-im/element-web/issues/9264)
Describe the solution you'd like
I would like to introduce changes to the SDK to allow guest send message, as well as enable guest to send typing notification.
So maybe remove
if (this.isGuest()) {
return Promise.resolve({}); // guests cannot send typing notifications so don't bother.
}
in MatrixClient.prototype.sendTyping and MatrixClient.prototype.sendReceipt in src/client.js.
And then maybe need to do something in _sendCompleteEvent,etc too?
The following API endpoints are allowed to be accessed by guest accounts for sending events:
POST /rooms/:room_id/join
POST /rooms/:room_id/leave
PUT /rooms/:room_id/send/m.room.message/:txn_id
PUT /sendToDevice/{eventType}/{txnId}
So it's implemented in Matrix that guest can PUT /rooms/:room_id/send/m.room.message/:txn_id?
I have not gone through synapse's source so I can't confirm that though.
Additional context
This is my day 1 of reading matrix-js-sdk's source. So will appreaciate any pointers!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the guest-access rules in matrix-doc/specification/modules/guest_access.rst, then inspect MatrixClient.prototype.sendTyping, sendReceipt, and _sendCompleteEvent in src/client.js. Compare the requested guest operations with the endpoints allowed by the specification and determine which behavior is supported. Done means the SDK's guest behavior matches the documented guest endpoints and the relevant operations are verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100