Skip to content

Commit 012a982

Browse files
jmartinespHywan
authored andcommitted
Revert "refactor(ffi): Remove unused Session::homeserver_url value"
This reverts commit 4eb3cc9.
1 parent 1c22d0b commit 012a982

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bindings/matrix-sdk-ffi/src/client.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2100,9 +2100,10 @@ impl Client {
21002100
fn session_inner(client: matrix_sdk::Client) -> Result<Session, ClientError> {
21012101
let auth_api = client.auth_api().context("Missing authentication API")?;
21022102

2103+
let homeserver_url = client.homeserver().into();
21032104
let sliding_sync_version = client.sliding_sync_version();
21042105

2105-
Session::new(auth_api, sliding_sync_version.into())
2106+
Session::new(auth_api, homeserver_url, sliding_sync_version.into())
21062107
}
21072108

21082109
fn save_session(
@@ -2394,6 +2395,8 @@ pub struct Session {
23942395
pub device_id: String,
23952396

23962397
// FFI-only fields (for now)
2398+
/// The URL for the homeserver used for this session.
2399+
pub homeserver_url: String,
23972400
/// Additional data for this session if OpenID Connect was used for
23982401
/// authentication.
23992402
pub oidc_data: Option<String>,
@@ -2404,6 +2407,7 @@ pub struct Session {
24042407
impl Session {
24052408
fn new(
24062409
auth_api: AuthApi,
2410+
homeserver_url: String,
24072411
sliding_sync_version: SlidingSyncVersion,
24082412
) -> Result<Session, ClientError> {
24092413
match auth_api {
@@ -2419,6 +2423,7 @@ impl Session {
24192423
refresh_token,
24202424
user_id: user_id.to_string(),
24212425
device_id: device_id.to_string(),
2426+
homeserver_url,
24222427
oidc_data: None,
24232428
sliding_sync_version,
24242429
})
@@ -2438,6 +2443,7 @@ impl Session {
24382443
refresh_token,
24392444
user_id: user_id.to_string(),
24402445
device_id: device_id.to_string(),
2446+
homeserver_url,
24412447
oidc_data,
24422448
sliding_sync_version,
24432449
})
@@ -2459,6 +2465,7 @@ impl TryFrom<Session> for AuthSession {
24592465
refresh_token,
24602466
user_id,
24612467
device_id,
2468+
homeserver_url: _,
24622469
oidc_data,
24632470
sliding_sync_version: _,
24642471
} = value;

0 commit comments

Comments
 (0)