-
Notifications
You must be signed in to change notification settings - Fork 253
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
sdk&ffi: server unstable features support for MSC4028 #3192
Merged
bnjbvr
merged 8 commits into
matrix-org:main
from
hanadi92:feat-server-unstable-features-support
Mar 8, 2024
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ffda84c
sdk: fetch unstable_features supported by homeserver
hanadi92 175fae5
ffi: add can_homeserver_push_encrypted_event_to_device method
hanadi92 c6f4119
fix: use copied instead of dereferencing
hanadi92 d9ed020
fix: move can_homeserver_push_encrypted_event_to_device logic to sdk
hanadi92 de21aaf
fix: remove unused unstable features param in client builder
hanadi92 fca3448
fix: use assert instead of asserteq for bool check
hanadi92 d84b611
fix: documentation
hanadi92 d8ffdd5
Apply suggestions from code review
bnjbvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use std::{fmt, sync::Arc}; | ||
use std::{collections::BTreeMap, fmt, sync::Arc}; | ||
|
||
use matrix_sdk_base::{store::StoreConfig, BaseClient}; | ||
use ruma::{ | ||
|
@@ -90,6 +90,7 @@ pub struct ClientBuilder { | |
request_config: RequestConfig, | ||
respect_login_well_known: bool, | ||
server_versions: Option<Box<[MatrixVersion]>>, | ||
unstable_features: Option<BTreeMap<String, bool>>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unused in |
||
handle_refresh_tokens: bool, | ||
base_client: Option<BaseClient>, | ||
#[cfg(feature = "e2e-encryption")] | ||
|
@@ -107,6 +108,7 @@ impl ClientBuilder { | |
request_config: Default::default(), | ||
respect_login_well_known: true, | ||
server_versions: None, | ||
unstable_features: None, | ||
handle_refresh_tokens: false, | ||
base_client: None, | ||
#[cfg(feature = "e2e-encryption")] | ||
|
@@ -508,6 +510,7 @@ impl ClientBuilder { | |
http_client, | ||
base_client, | ||
self.server_versions, | ||
self.unstable_features, | ||
self.respect_login_well_known, | ||
event_cache, | ||
#[cfg(feature = "e2e-encryption")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bit of logic here, and I think that this could be useful for other clients. Could this method go to the SDK, next to
unstable_features
, please? (and add a test for it too 🙏)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course! good hint. let me know if what I pushed goes in the direction of ur suggestion 👍