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

sdk: move get_profile from Client to Account #3238

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

jmartinesp
Copy link
Contributor

Also rename existing Account::get_profile to Account::get_current_user_profile and reuse the new function.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

Also rename existing `Account::get_profile` to `Account::get_current_user_profile` and reuse the new function.
@jmartinesp jmartinesp requested a review from a team as a code owner March 19, 2024 10:25
@jmartinesp jmartinesp requested review from andybalaam and removed request for a team March 19, 2024 10:25
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 83.63%. Comparing base (10069fb) to head (6d3e492).
Report is 4 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk/src/account.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3238   +/-   ##
=======================================
  Coverage   83.63%   83.63%           
=======================================
  Files         236      236           
  Lines       24419    24419           
=======================================
  Hits        20423    20423           
  Misses       3996     3996           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - please can you document the API changes in the changelog?

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though we'd like some alternative names.

/// println!(
/// "You are '{:?}' with avatar '{:?}'",
/// profile.displayname, profile.avatar_url
/// );
/// # anyhow::Ok(()) };
/// ```
pub async fn get_profile(&self) -> Result<get_profile::v3::Response> {
pub async fn get_current_user_profile(&self) -> Result<get_profile::v3::Response> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked to some folks in the SDK team.

We agreed that we'd prefer this to be called: fetch_user_profile().

/// # Arguments
///
/// * `user_id` the matrix id this function downloads the profile for
pub async fn get_profile(&self, user_id: &UserId) -> Result<get_profile::v3::Response> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one should be called fetch_user_profile_of().

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please just add a changelog entry like @andybalaam requested.

@poljar poljar enabled auto-merge (squash) March 19, 2024 11:54
@poljar poljar merged commit 0c4b62f into main Mar 19, 2024
35 checks passed
@poljar poljar deleted the misc/jme/move-get_profile-to-account branch March 19, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants