Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): Use the new sliding sync version API from the Rust SDK #128

Merged
merged 5 commits into from
Sep 3, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions internal/api/rust/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ type RustClient struct {
func NewRustClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, error) {
t.Logf("NewRustClient[%s][%s] creating...", opts.UserID, opts.DeviceID)
matrix_sdk_ffi.LogEvent("rust.go", &zero, matrix_sdk_ffi.LogLevelInfo, t.Name(), fmt.Sprintf("NewRustClient[%s][%s] creating...", opts.UserID, opts.DeviceID))
ab := matrix_sdk_ffi.NewClientBuilder().HomeserverUrl(opts.BaseURL).SlidingSyncProxy(&opts.SlidingSyncURL).AutoEnableCrossSigning(true)
slidingSyncVersion := matrix_sdk_ffi.SlidingSyncVersionBuilderProxy{Url: opts.SlidingSyncURL}
ab := matrix_sdk_ffi.NewClientBuilder().
HomeserverUrl(opts.BaseURL).
SlidingSyncVersionBuilder(slidingSyncVersion).
AutoEnableCrossSigning(true)
var clientSessionDelegate matrix_sdk_ffi.ClientSessionDelegate
if opts.EnableCrossProcessRefreshLockProcessName != "" {
t.Logf("enabling cross process refresh lock with proc name=%s", opts.EnableCrossProcessRefreshLockProcessName)
Expand All @@ -90,11 +94,11 @@ func NewRustClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, erro
}
if opts.AccessToken != "" { // restore the session
session := matrix_sdk_ffi.Session{
AccessToken: opts.AccessToken,
UserId: opts.UserID,
DeviceId: opts.DeviceID,
HomeserverUrl: opts.BaseURL,
SlidingSyncProxy: &opts.SlidingSyncURL,
AccessToken: opts.AccessToken,
UserId: opts.UserID,
DeviceId: opts.DeviceID,
HomeserverUrl: opts.BaseURL,
SlidingSyncVersion: &slidingSyncVersion,
}
if err := client.RestoreSession(session); err != nil {
return nil, fmt.Errorf("RestoreSession: %s", err)
Expand Down
Loading