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])
49inline auto toJson(
const EventContent::AllowCondition& c)
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])
67inline auto toJson(
const EventContent::JoinRuleContent& c)
70 addParam<IfNotEmpty>(jo,
"join_rule"_L1, enumToJsonString<JoinRule>(c.joinRule, EventContent::JoinRuleStrings));
71 addParam<IfNotEmpty>(jo,
"allow"_L1, c.allow);
79 :
public KeylessStateEventBase<JoinRulesEvent, EventContent::JoinRuleContent>
82 QUO_EVENT(JoinRulesEvent,
"m.room.join_rules")
83 using KeylessStateEventBase::KeylessStateEventBase;
88 JoinRule joinRule()
const {
return content().joinRule; }
93 QList<EventContent::AllowCondition> allow()
const {
return content().allow; }
Class to define a join rule state event.
#define QUO_EVENT(CppType_, MatrixType_)
Supply event metatype information in (specific) event types.
constexpr std::array JoinRuleStrings
auto toJson(const EventContent::AllowCondition &c)
EventContent::AllowCondition fromJson(const QJsonObject &jo)
Definition of an allow AllowCondition.
The content of a join rule event.