Set power level from userdetaildialog

Add the option to set powerlevel to userdetaildialog.

This is done by making the powerleveldialog into it's own file and using that.

implements network/neochat#570
This commit is contained in:
James Graham
2023-03-05 22:44:04 +00:00
committed by Tobias Fella
parent e6a060c192
commit bd4eeb405b
6 changed files with 115 additions and 37 deletions

View File

@@ -1075,6 +1075,12 @@ void NeoChatRoom::setHistoryVisibility(const QString &historyVisibilityRule)
// Not emitting historyVisibilityChanged() here, since that would override the change in the UI with the *current* value, which is not the *new* value.
}
int NeoChatRoom::getUserPowerLevel(const QString &userId) const
{
auto powerLevelEvent = getCurrentState<RoomPowerLevelsEvent>();
return powerLevelEvent->powerLevelForUser(userId);
}
void NeoChatRoom::setUserPowerLevel(const QString &userID, const int &powerLevel)
{
if (joinedCount() <= 1) {