-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add joinrule api and joinrulesevent
- Loading branch information
1 parent
e20f13f
commit f08e95f
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-FileCopyrightText: 2019 Kitsune Ral <[email protected]> | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
#include "joinrulesevent.h" | ||
|
||
using namespace Quotient; | ||
|
||
QString JoinRulesEvent::joinRule() const | ||
{ | ||
return fromJson<QString>(contentJson()["join_rule"_ls]); | ||
} | ||
|
||
QJsonArray JoinRulesEvent::allow() const | ||
{ | ||
return contentJson()["allow"_ls].toArray(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-FileCopyrightText: 2021 Carl Schwan <[email protected]> | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
#pragma once | ||
|
||
#include "stateevent.h" | ||
namespace Quotient { | ||
class JoinRulesEvent : public StateEvent { | ||
public: | ||
QUO_EVENT(JoinRulesEvent, "m.room.join_rules") | ||
|
||
explicit JoinRulesEvent(const QJsonObject& obj) : StateEvent(obj) {} | ||
|
||
QString joinRule() const; | ||
QJsonArray allow() const; | ||
}; | ||
REGISTER_EVENT_TYPE(JoinRulesEvent) | ||
} // namespace Quotient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters