matrixion/src/timeline/Permissions.h

36 lines
675 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QObject>
#include <mtx/events/power_levels.hpp>
class TimelineModel;
class Permissions : public QObject
{
2021-09-18 01:22:33 +03:00
Q_OBJECT
public:
2021-09-18 01:22:33 +03:00
Permissions(QString roomId, QObject *parent = nullptr);
2021-09-18 01:22:33 +03:00
Q_INVOKABLE bool canInvite();
Q_INVOKABLE bool canBan();
Q_INVOKABLE bool canKick();
2021-09-18 01:22:33 +03:00
Q_INVOKABLE bool canRedact();
Q_INVOKABLE bool canChange(int eventType);
Q_INVOKABLE bool canSend(int eventType);
2021-09-18 01:22:33 +03:00
Q_INVOKABLE bool canPingRoom();
2021-09-18 01:22:33 +03:00
void invalidate();
private:
2021-09-18 01:22:33 +03:00
QString roomId_;
mtx::events::state::PowerLevels pl;
};