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

@@ -153,6 +153,14 @@ public:
[[nodiscard]] QString historyVisibility() const;
void setHistoryVisibility(const QString &historyVisibilityRule);
/**
* @brief Get the power level for the given user ID in the room.
*
* Returns the default value for a user in the room if they have no escalated
* privileges or if they are not a member so membership should be known before using.
*/
Q_INVOKABLE [[nodiscard]] int getUserPowerLevel(const QString &userId) const;
Q_INVOKABLE void setUserPowerLevel(const QString &userID, const int &powerLevel);
[[nodiscard]] int powerLevel(const QString &eventName, const bool &isStateEvent = false) const;