We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc071ba commit b5b2450Copy full SHA for b5b2450
bindings/matrix-sdk-ffi/src/client_builder.rs
@@ -57,6 +57,18 @@ impl QrCodeData {
57
pub fn from_bytes(bytes: Vec<u8>) -> Result<Arc<Self>, QrCodeDecodeError> {
58
Ok(Self { inner: qrcode::QrCodeData::from_bytes(&bytes)? }.into())
59
}
60
+
61
+ /// The server name contained within the scanned QR code data.
62
+ ///
63
+ /// Note: This value is only present when scanning a QR code the belongs to
64
+ /// a logged in client. The mode where the new client shows the QR code
65
+ /// will return `None`.
66
+ pub fn server_name(&self) -> Option<String> {
67
+ match &self.inner.mode_data {
68
+ QrCodeModeData::Reciprocate { server_name } => Some(server_name.to_owned()),
69
+ QrCodeModeData::Login => None,
70
+ }
71
72
73
74
/// Error type for the decoding of the [`QrCodeData`].
0 commit comments