Skip to content

change(ffi): expose the full RoomPowerLevels object and move corresponding methods to it#5250

Merged
stefanceriu merged 2 commits intomainfrom
stefan/roomPowerLevels
Jun 19, 2025
Merged

change(ffi): expose the full RoomPowerLevels object and move corresponding methods to it#5250
stefanceriu merged 2 commits intomainfrom
stefan/roomPowerLevels

Conversation

@stefanceriu
Copy link
Copy Markdown
Member

This patch expands on the already existent RoomPowerLevels record (which it renames to RoomPowerLevelsValues to work around uniffi not exposing public fields) and nests them inside a new exported object that also provides methods for retrieving the actions that an user can take, methods moved from the room object. This reduces the amount of async calls the clients need to make, simplifies the API and groups the code better together.

On the sdk/base level those methods can be removed as the underlying power levels are already exposed.

@stefanceriu stefanceriu force-pushed the stefan/roomPowerLevels branch from d3ebbc9 to 369c75f Compare June 19, 2025 08:35
@stefanceriu stefanceriu marked this pull request as ready for review June 19, 2025 12:02
@stefanceriu stefanceriu requested a review from a team as a code owner June 19, 2025 12:02
@stefanceriu stefanceriu requested review from andybalaam and removed request for a team June 19, 2025 12:02
Copy link
Copy Markdown
Member

@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 sensible to me, but the CI is moaning about some formatting.

@stefanceriu stefanceriu force-pushed the stefan/roomPowerLevels branch from e418d83 to 2c6a0e0 Compare June 19, 2025 14:23
@poljar
Copy link
Copy Markdown
Contributor

poljar commented Jun 19, 2025

Looks sensible to me, but the CI is moaning about some formatting.

It just needs a bit of a rebase onto main.

…nding methods to it.

This patch expands on the already existent `RoomPowerLevels` record (which it renames to `RoomPowerLevelsValues` to work around uniffi not exposing public fields) and nests them inside a new exported object that also provides methods for retrieving the actions that an user can take, methods moved from the room object.
This reduces the amount of async calls the clients need to make, simplifies the API and groups the code better together.
@stefanceriu stefanceriu force-pushed the stefan/roomPowerLevels branch from 2c6a0e0 to f580f2e Compare June 19, 2025 14:31
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 19, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.18%. Comparing base (040fd6c) to head (f580f2e).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/room/mod.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5250      +/-   ##
==========================================
+ Coverage   90.13%   90.18%   +0.04%     
==========================================
  Files         334      334              
  Lines      104717   104681      -36     
  Branches   104717   104681      -36     
==========================================
+ Hits        94387    94404      +17     
+ Misses       6277     6224      -53     
  Partials     4053     4053              

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

@stefanceriu
Copy link
Copy Markdown
Member Author

All green, thank you gents!

@stefanceriu stefanceriu merged commit 47c8df0 into main Jun 19, 2025
44 checks passed
@stefanceriu stefanceriu deleted the stefan/roomPowerLevels branch June 19, 2025 14:55
poljar added a commit that referenced this pull request Jul 10, 2025
poljar added a commit that referenced this pull request Jul 10, 2025
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