Skip to content

Commit

Permalink
Merge pull request #128 from Hywan/fix-sdk-sliding-sync-version
Browse files Browse the repository at this point in the history
fix(api): Use the new sliding sync version API from the Rust SDK
  • Loading branch information
kegsay authored Sep 3, 2024
2 parents 0c7756b + 119a8c7 commit 7da7422
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 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,13 @@ 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: matrix_sdk_ffi.SlidingSyncVersionProxy{
Url: opts.SlidingSyncURL,
},
}
if err := client.RestoreSession(session); err != nil {
return nil, fmt.Errorf("RestoreSession: %s", err)
Expand Down

0 comments on commit 7da7422

Please sign in to comment.