File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
bindings/matrix-sdk-ffi/src Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ impl QrCodeData {
57
57
pub fn from_bytes ( bytes : Vec < u8 > ) -> Result < Arc < Self > , QrCodeDecodeError > {
58
58
Ok ( Self { inner : qrcode:: QrCodeData :: from_bytes ( & bytes) ? } . into ( ) )
59
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
+ }
60
72
}
61
73
62
74
/// Error type for the decoding of the [`QrCodeData`].
You can’t perform that action at this time.
0 commit comments