Add support for delayed event (MSC4140) - #6973
Open
BillCarsonFr wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6973 +/- ##
=======================================
Coverage 90.23% 90.23%
=======================================
Files 408 408
Lines 117281 117352 +71
Branches 117281 117352 +71
=======================================
+ Hits 105823 105893 +70
- Misses 7511 7521 +10
+ Partials 3947 3938 -9 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation: I am working on a rust rtc stack https://github.com/BillCarsonFr/matrix-rust-rtc. , and some of the needed primitive are missing in rust-sdk.
I am starting with support of delayed event (state events and room event).
Currently the widget driver had some support for it (by using raw ruma requests), and I am moving it so it became part of the API.
While doing so I noticed that the driver implementation was faulty:
M_FORBIDDEN: MatrixError: [403] Sending delayed events has been disallowedA note on the send event future, I cannot just add an optional parameter to
SendRawMessageLikeEventbecause delayed event returns a delayed_id, and the send event future returns aOwnedEventIdIn order to share the encryption code, I created an intermediate future
PreparedMessageLikeEventthat handles the common part before the ruma request.I added a
SendRawMessageLikeEvent::with_delaythat converts to the newSendDelayedRawMessageLikeEventfutureSigned-off-by: