Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session verification request support #4153

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Oct 18, 2024

This PR introduced FFI level API support for interacting with incoming session verification requests. Best reviewed commit by commit

  • it exposes a new did_receive_verification_request SessionVerificationController delegate method that includes information about the incoming request/device/sender
  • the client can acknowledge_verification_request to get informed about it getting accepted somewhere else or cancelled
  • the client can also accept_verification_request to start interacting with it

This PR also internally switches to the VerificationRequest::changes publisher, fixes a couple of invalid VerificationMachine tests and starts storing requesting DeviceData directly in VerificationRequestState. Requested

Relates to element-hq/element-meta/issues/2464, fixes #3595.

pub async fn is_verified(&self) -> Result<bool, ClientError> {
let device =
self.encryption.get_own_device().await?.context("Our own device is missing")?;
pub fn set_delegate(&self, delegate: Option<Box<dyn SessionVerificationControllerDelegate>>) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I considered switching away from a delegate and towards a listener but the public api changes are so small that I don't really thing it's worth it at this point. Let's reassess when we start thinking about user verification.

/// request.
other_device_id: OwnedDeviceId,
other_device_data: DeviceData,
Copy link
Member Author

Choose a reason for hiding this comment

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

@poljar We initially agreed to pass this DeviceData down into the Transitioned state but I couldn't identify were that would be useful 🤔

@stefanceriu
Copy link
Member Author

Please double check the commit messages, I tried making them fit the new contributing guidelines but not sure I nailed it.

pub async fn acknowledge_verification_request(
&self,
sender_id: String,
flow_id: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a quick question regarding API usage: the flow_id is not enough here? We need to also provide the sender_id? (I believe that those data are coming from SessionVerificationRequestDetails).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Receiving a verification request does not work
2 participants