From 40f99cb364799cfb49ac74c009b83623ff33a236 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 3 Sep 2021 21:46:33 +0200 Subject: [PATCH] state-res: Update verify_third_party_invite signature Use &UserId instead of &str. --- crates/ruma-state-res/src/event_auth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruma-state-res/src/event_auth.rs b/crates/ruma-state-res/src/event_auth.rs index c9e507ed..d650aa00 100644 --- a/crates/ruma-state-res/src/event_auth.rs +++ b/crates/ruma-state-res/src/event_auth.rs @@ -418,7 +418,7 @@ where false } else { let allow = verify_third_party_invite( - Some(state_key), + Some(&target_user_id), user_sender, &tp_id, current_third_party_invite, @@ -854,7 +854,7 @@ where } pub fn verify_third_party_invite( - user_state_key: Option<&str>, + target_user: Option<&UserId>, sender: &UserId, tp_id: &ThirdPartyInvite, current_third_party_invite: Option>, @@ -863,7 +863,7 @@ pub fn verify_third_party_invite( // checking for mxid and token keys is done by ruma when deserializing // The state key must match the invitee - if user_state_key != Some(tp_id.signed.mxid.as_str()) { + if target_user != Some(&tp_id.signed.mxid) { return false; }