6#include "../quotient_common.h"
27 "knock_restricted"_L1,
42 return EventContent::AllowCondition {
43 fromJson<QString>(jo[
"room_id"_L1]),
44 fromJson<QString>(jo[
"type"_L1])
52 addParam<IfNotEmpty>(jo,
"room_id"_L1, c.roomId);
53 addParam<IfNotEmpty>(jo,
"type"_L1, c.type);
60 return EventContent::JoinRuleContent {
61 enumFromJsonString<JoinRule>(jo[
"join_rule"_L1].toString(), EventContent::JoinRuleStrings).value_or(Public),
62 fromJson<QList<EventContent::AllowCondition>>(jo[
"allow"_L1])
70 addParam<IfNotEmpty>(jo,
"join_rule"_L1, enumToJsonString<JoinRule>(c.joinRule, EventContent::JoinRuleStrings));
71 addParam<IfNotEmpty>(jo,
"allow"_L1, c.allow);
Class to define a join rule state event.
QList< EventContent::AllowCondition > allow() const
The allow rules for restricted rooms.
JoinRule joinRule() const
The join rule for the room.
#define QUO_EVENT(CppType_, MatrixType_)
Supply event metatype information in (specific) event types.
constexpr std::array JoinRuleStrings
auto toJson(const EventContent::AllowCondition &c)
bool fromJson(const QJsonValue &jv)
JoinRule
Enum representing the available room join rules.
auto toJson(const EventContent::JoinRuleContent &c)
Definition of an allow AllowCondition.
The content of a join rule event.
QList< AllowCondition > allow