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

tolerate ranges of power levels for logged-in users to avoid conflicts #263

Merged
merged 2 commits into from
Jun 4, 2022

Conversation

maltee1
Copy link
Contributor

@maltee1 maltee1 commented May 26, 2022

Fixes #258

for logged-in users:
for DEFAULT, the power level is between 0 and 49
for ADMINISTRATOR, the power level is >50
The bot will only change the power level if it is outside those ranges.

for signal puppets, nothing changes.

If the current power level of the user is higher than that of the bridge bot, don't attempt to change it. While the power level may have to be changed, it's pointless to try.
Likewise, if the bot power level is <50, it won't be able to do anything useful and it's pointless to try. We already print a warning for that.

This PR avoids conflicts with other bridges trying to set different power levels (pl 75 is default for the group creator in telegram, in whatsapp it's 95). It will also allow setting power levels even if they can't be set for some users. Previously, a single, impossible power level change would make the entire command fail, causing no power level changes to be made.

mautrix_signal/portal.py Outdated Show resolved Hide resolved
Co-authored-by: Tulir Asokan <tulir@maunium.net>
@tulir tulir merged commit 8c8b053 into mautrix:master Jun 4, 2022
@maltee1 maltee1 deleted the power_level_ranges branch June 6, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Tolerate ranges of power levels for logged-in matrix users
2 participants