-
-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
MatrixClient.encryptAndSendEvent
(#4031)
* Replace `pendingEventEncryption` with a Set We don't actually need the promise, so no need to save it. This also fixes a resource leak, where we would leak a Promise and a HashMap entry on each encrypted event. * Convert `encryptEventIfNeeded` to async function This means that it will always return a promise, so `encryptAndSendEvent` can't tell if we are actually encrypting or not. Hence, also move the `updatePendingEventStatus` into `encryptEventIfNeeded`. * Simplify `encryptAndSendEvent` Rewrite this as async. * Factor out `MatrixClient.shouldEncryptEventForRoom` * Inline a call to `isRoomEncrypted` I want to deprecate this thing
- Loading branch information
Showing
4 changed files
with
128 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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