Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels commented Nov 7, 2019

Implements element-hq/element-web#11251
Requires: matrix-org/matrix-js-sdk#1067

This PR implements sending verification requests over direct messages, which can be enabled with the feature_dm_verification feature flag. Verification is still initiated through the usual DeviceVerifyDialog dialog, e.g. by clicking "verify" next to a device in the member info. Reworking that will come in a later PR.

During verification, two tiles are shown in the timeline: one for the request (the m.key.verification.request event), and one for the conclusion (either m.key.verification.cancel or m.key.verification.done event), as per the design. All the events have an m.reference relationship with the first request event (see spec), so I put the code to monitor all of this as events come in in KeyVerificationStateObserver as both the MKeyVerificationRequest and MKeyVerificationConclusion need to be aware of the current state of the request.

The styling for both tiles is identical, so I just called the classes mx_KeyVerification to share them between the two components for lack of a better idea, even though that doesn't really follow our guidelines. Feel free to suggest a better idea for this.

The "bubble" style adds an alternative layout for an event tile, using css grid to overlap the container where the bubble is centered with the timestamp on the left and the read receipts on the right. The bubble doesn't actually visually overlap as it is is centered and has a max-width.

verify-dm-dark-theme

verify-dm-verified

as we will have 2 tiles, and both need to track the status of the verification request, I've put the logic for tracking the state in this helper class to use from both tiles.
only if the request was send by or to us, otherwise ignore.
don't render any done events not sent by us, as done events are sent by both parties and we don't want to render two conclusion tiles. cancel events should be only sent by one party.
@bwindels bwindels requested a review from a team November 7, 2019 19:05
@dbkr dbkr requested review from dbkr and removed request for a team November 8, 2019 09:37
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scss linter being annoying. This looks really nice - I like the state observer.

@dbkr dbkr merged commit 43c6298 into develop Nov 8, 2019
turt2live added a commit that referenced this pull request Nov 8, 2019
Redacted messages do not have message types, despite being room messages. Fixes element-hq/element-web#11352 Regressed in #3601 Click-to-ping being broken (as mentioned by element-hq/element-web#11353) is a side effect of the react stack falling over. Once one room crashes, click-to-ping is broken everywhere.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants