tolerate ranges of power levels for logged-in users to avoid conflicts #263
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.