Skip to content

Commit

Permalink
add tolerances to userlevels, update ROADMAP.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maltee1 committed Feb 14, 2024
1 parent f7193d4 commit 0fccbd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* [x] Request join (via invite link, requires a client that supports knocks)
* [x] Leave
* [x] Kick/Ban/Unban
* [ ] Group permissions
* [x] Group permissions
* [x] Typing notifications
* [x] Read receipts
* [ ] Delivery receipts (there's no good way to bridge these)
Expand Down
4 changes: 3 additions & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,9 @@ func (portal *Portal) updatePowerLevelsAndJoinRule(ctx context.Context, info *si
botLevel := levels.GetUserLevel(portal.MainIntent().UserID)
changed := false
for mxid, level := range members {
if levels.GetUserLevel(mxid) < botLevel {
oldLevel := levels.GetUserLevel(mxid)
difference := oldLevel - level
if oldLevel < botLevel && (difference < 0 || difference > 49) {
changed = levels.EnsureUserLevel(mxid, level) || changed
}
}
Expand Down

0 comments on commit 0fccbd7

Please sign in to comment.