Skip to content

feat[bindings]: expose power level thresholds in corresponding timeline event#5931

Merged
poljar merged 10 commits into
matrix-org:mainfrom
JoFrost:main
Jan 20, 2026
Merged

feat[bindings]: expose power level thresholds in corresponding timeline event#5931
poljar merged 10 commits into
matrix-org:mainfrom
JoFrost:main

Conversation

@JoFrost

@JoFrost JoFrost commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Hello! This PR exposes power-level thresholds in OtherState::RoomPowerLevels for the FFI timeline.

It includes action requirements such as ban, kick, invite, redact, state_default, events_default, per-event overrides and notifications. This gives FFI clients direct access to the effective power levels of a room, which were previously unavailable.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@JoFrost JoFrost requested a review from a team as a code owner December 5, 2025 09:29
@JoFrost JoFrost requested review from poljar and removed request for a team December 5, 2025 09:29
@codecov

codecov Bot commented Dec 5, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.93%. Comparing base (d64c990) to head (eb13eee).
⚠️ Report is 38 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5931   +/-   ##
=======================================
  Coverage   88.93%   88.93%           
=======================================
  Files         357      357           
  Lines       99195    99195           
  Branches    99195    99195           
=======================================
+ Hits        88221    88223    +2     
+ Misses       6991     6988    -3     
- Partials     3983     3984    +1     

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

@codspeed-hq

codspeed-hq Bot commented Dec 5, 2025

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing JoFrost:main (2ff1f66) with main (0053ecb)

Open in CodSpeed

@JoFrost

JoFrost commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

Hello @poljar! Quick check on this PR.

I wanted to confirm whether this aligns with the intended API direction, or if you’d prefer to wait for #5937 to be merged and then have this rebased on top of it.
If this approach doesn’t hit the mark, I’m happy to close the PR.

Thanks.

@poljar

poljar commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

I wanted to confirm whether this aligns with the intended API direction, or if you’d prefer to wait for #5937 to be merged and then have this rebased on top of it.

Yes, let's do that, I don't think there's much blocking #5937 so it should be merged soon™.

@JoFrost

JoFrost commented Dec 21, 2025

Copy link
Copy Markdown
Contributor Author

All done @poljar. I rebased on main, and used what was introduced in #5937 for this PR.

Signed-off-by: JoFrost <20685007+JoFrost@users.noreply.github.com>
Signed-off-by: JoFrost <20685007+JoFrost@users.noreply.github.com>

@poljar poljar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay, this got rebased over my holidays.

Looks mostly good, I left a couple of nits.

Comment thread bindings/matrix-sdk-ffi/CHANGELOG.md Outdated
the user who forwarded the keys used to decrypt the event as part of an [MSC4268](https://github.com/matrix-org/matrix-spec-proposals/pull/4268)
key bundle.
([#6000](https://github.com/matrix-org/matrix-rust-sdk/pull/6000))
- Expose room power level thresholds in `OtherState::RoomPowerLevels` (ban, kick, invite, redact, state &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New entries to the top please.

events: HashMap<TimelineEventType, i64>,
previous_events: Option<HashMap<TimelineEventType, i64>>,
users: HashMap<String, i64>,
previous: Option<HashMap<String, i64>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we rename this to prevoius_users like the other fields have the previous prefix.

@JoFrost

JoFrost commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

No worries. All done, btw @poljar!

@poljar poljar enabled auto-merge (rebase) January 19, 2026 16:11
auto-merge was automatically disabled January 19, 2026 16:17

Rebase failed

@poljar poljar merged commit a3111e7 into matrix-org:main Jan 20, 2026
59 of 60 checks passed
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.

2 participants