crypto: Add a getter for the room id for the SAS verifications

master
Damir Jelić 2021-06-25 12:56:30 +02:00
parent af084528c8
commit 728d298810
1 changed files with 9 additions and 0 deletions

View File

@ -89,6 +89,15 @@ impl Sas {
&self.flow_id &self.flow_id
} }
/// Get the room id if the verification is happening inside a room.
pub fn room_id(&self) -> Option<&RoomId> {
if let FlowId::InRoom(r, _) = self.flow_id() {
Some(r)
} else {
None
}
}
/// Does this verification flow support displaying emoji for the short /// Does this verification flow support displaying emoji for the short
/// authentication string. /// authentication string.
pub fn supports_emoji(&self) -> bool { pub fn supports_emoji(&self) -> bool {