mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
event/powerlevels: fix some set user level calls in v12 rooms
This commit is contained in:
parent
75ad1961d5
commit
5d87d14b88
1 changed files with 6 additions and 0 deletions
|
|
@ -135,6 +135,12 @@ func (pl *PowerLevelsEventContent) GetUserLevel(userID id.UserID) int {
|
|||
func (pl *PowerLevelsEventContent) SetUserLevel(userID id.UserID, level int) {
|
||||
pl.usersLock.Lock()
|
||||
defer pl.usersLock.Unlock()
|
||||
if pl.isCreator(userID) {
|
||||
return
|
||||
}
|
||||
if level == math.MaxInt {
|
||||
level = 1<<53 - 1
|
||||
}
|
||||
if level == pl.UsersDefault {
|
||||
delete(pl.Users, userID)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue