| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <QObject> |
| 8 |
|
| 9 |
#include <mtx/events/power_levels.hpp> |
| 10 |
|
| 11 |
class TimelineModel; |
| 12 |
|
| 13 |
class Permissions final : public QObject |
| 14 |
{ |
| 15 |
Q_OBJECT |
| 16 |
|
| 17 |
public: |
| 18 |
Permissions(QString roomId, QObject *parent = nullptr); |
| 19 |
|
| 20 |
Q_INVOKABLE bool canInvite(); |
| 21 |
Q_INVOKABLE bool canBan(); |
| 22 |
Q_INVOKABLE bool canKick(); |
| 23 |
|
| 24 |
Q_INVOKABLE bool canRedact(); |
| 25 |
Q_INVOKABLE bool canChange(int eventType); |
| 26 |
Q_INVOKABLE bool canSend(int eventType); |
| 27 |
Q_INVOKABLE int defaultLevel(); |
| 28 |
Q_INVOKABLE int redactLevel(); |
| 29 |
Q_INVOKABLE int changeLevel(int eventType); |
| 30 |
Q_INVOKABLE int sendLevel(int eventType); |
| 31 |
|
| 32 |
Q_INVOKABLE bool canPingRoom(); |
| 33 |
|
| 34 |
void invalidate(); |
| 35 |
|
| 36 |
const mtx::events::state::PowerLevels &powerlevelEvent() const { return pl; }; |
| 37 |
|
| 38 |
private: |
| 39 |
QString roomId_; |
| 40 |
mtx::events::state::PowerLevels pl; |
| 41 |
}; |