* Add comments.
* Implment MSC3873 to handle escaped dots in keys.
* Add some comments about tests.
* Clarify spec behavior.
* Fix typo.
* Don't manually iterate string.
* Clean-up tests.
* Simplify tests.
* Add more tests & fix bug with empty parts.
* Add more edge cases.
* Add a regular expression solution.
This is ~80% slower than the basic split(".").
* Split on a simpler regular expression.
This is ~50% slower than a simple split(".").
* Remove redundant case in regex.
* Enable sticky regex.
* Rollback use of regex.
* Cache values in the PushProcessor.
* Use more each in tests.
* Pre-calculate the key parts instead of caching them.
* Fix typo.
* Switch back to external cache, but clean out obsolete cached values.
* Remove obsolete property.
* Remove more obsolete properties.
* Add isEncryptedDisabledForUnverifiedDevices in event.ts
* Add Tests
* Add isEncryptedDisabledForUnverifiedDevices properties to event
* Use WITHHELD_MESSAGES instead of hardcoded string
* Use getter instead of function
* Add documentation
* Validate vars early
* Split out unread counts for total and highlight to different logic blocks
* Add tests for ignoring non notifying events
* Fix possibly incorrect tests?
* lint fix
* Refactor currentTotalCount
* Track Total locally too
* Lots of total count assumptions and comments
* Adjust for threading too
* Fixup tests
* a word
* lint fix
* first cut poll model
* process incoming poll relations
* allow alt event types in relations model
* allow alt event types in relations model
* remove unneccesary checks on remove relation
* comment
* Revert "allow alt event types in relations model"
This reverts commit e578d84464.
* Revert "Revert "allow alt event types in relations model""
This reverts commit 515db7a8bc.
* basic handling for new poll relations
* tests
* test room.processPollEvents
* join processBeaconEvents and poll events in client
* tidy and set 23 copyrights
* use rooms instance of matrixClient
* tidy
* more copyright
* simplify processPollEvent code
* throw when poll start event has no roomId
* updates for events-sdk move
* more type changes for events-sdk changes
* page poll relation results
* validate poll end event senders
* reformatted copyright
* undo more comment reformatting
* test paging
* use correct pollstartevent type
* emit after updating _isFetchingResponses state
* make rootEvent public readonly
* fix poll end validation logic to allow poll creator to end poll regardless of redaction
* first cut poll model
* process incoming poll relations
* allow alt event types in relations model
* allow alt event types in relations model
* remove unneccesary checks on remove relation
* comment
* Revert "allow alt event types in relations model"
This reverts commit e578d84464.
* Revert "Revert "allow alt event types in relations model""
This reverts commit 515db7a8bc.
* basic handling for new poll relations
* tests
* test room.processPollEvents
* join processBeaconEvents and poll events in client
* tidy and set 23 copyrights
* use rooms instance of matrixClient
* tidy
* more copyright
* simplify processPollEvent code
* throw when poll start event has no roomId
* updates for events-sdk move
* more type changes for events-sdk changes
* validate poll end event senders
* reformatted copyright
* undo more comment reformatting
* fix poll end validation logic to allow poll creator to end poll regardless of redaction
* Update src/models/poll.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* correct creator == sender validationin poll end
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* first cut poll model
* process incoming poll relations
* allow alt event types in relations model
* allow alt event types in relations model
* remove unneccesary checks on remove relation
* comment
* Revert "allow alt event types in relations model"
This reverts commit e578d84464.
* Revert "Revert "allow alt event types in relations model""
This reverts commit 515db7a8bc.
* basic handling for new poll relations
* tests
* test room.processPollEvents
* join processBeaconEvents and poll events in client
* tidy and set 23 copyrights
* use rooms instance of matrixClient
* tidy
* more copyright
* simplify processPollEvent code
* throw when poll start event has no roomId
* updates for events-sdk move
* more type changes for events-sdk changes
* comment
I introduced a flaky test to confirm that `MegolmEncryption#prepareToEncrypt`
didn't block the main thread too much, but it turns out that, when run in
varying environments, it tends to fail.
The same behavior is guaranteed by the following cancellation test - if the
thread is blocked, it can't be cancelled.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
These are all called by the react-sdk when showing an encrypted event:
* `getEventEncryptionInfo`
* `checkUserTrust`
* `checkDeviceTrust`
I don't particularly want to keep this API, but as a rapid means to an end,
let's stub them for now.
NOTE: This commit introduces a backwards-compatible API change.
Adds the ability to cancel `MegolmEncryption#prepareToEncrypt` by returning
a cancellation function. The bulk of the processing happens in
`getDevicesInRoom`, which now accepts a 'getter' that allows the caller to
indicate cancellation.
See https://github.com/matrix-org/matrix-js-sdk/issues/1255Closes#1255
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Adds an async/promise-based version of `setImmediate`. Note that, despite being
poorly adopted, `setImmediate` is polyfilled, and should be more performant
than `sleep(0)`.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use a PrefixedLogger throughout `megolm.ts`
Rather than manually adding `in ${this.roomId}` to each log line, use a
PrefixedLogger to achieve the same effect more consistently.
* Clean up logging in megolm.ts
Where we log a list of devices, we don't need the whole deviceinfo, just the
device id. All that noise makes it very hard to read the logs.
* Log users that we find in the room when encrypting
* Reduce log verbosity on decryption retries