6#include "../quotient_common.h"
36 return EventContent::AllowCondition {
37 fromJson<QString>(jo[RoomIdKey]),
38 fromJson<QString>(jo[TypeKey])
43inline auto toJson(
const EventContent::AllowCondition& c)
46 addParam<IfNotEmpty>(jo, RoomIdKey, c.roomId);
47 addParam<IfNotEmpty>(jo, TypeKey, c.type);
54 return EventContent::JoinRuleContent{fromJson<JoinRule>(jo[JoinRuleKey]),
55 fromJson<QList<EventContent::AllowCondition>>(
60inline auto toJson(
const EventContent::JoinRuleContent& c)
63 addParam<IfNotEmpty>(jo, JoinRuleKey, c.joinRule);
64 addParam<IfNotEmpty>(jo, AllowKey, c.allow);
72 :
public KeylessStateEventBase<JoinRulesEvent, EventContent::JoinRuleContent>
75 QUO_EVENT(JoinRulesEvent,
"m.room.join_rules")
76 using KeylessStateEventBase::KeylessStateEventBase;
81 JoinRule joinRule()
const {
return content().joinRule; }
86 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.
auto toJson(const EventContent::AllowCondition &c)
constexpr auto JoinRuleKey
EventContent::AllowCondition fromJson(const QJsonObject &jo)
Definition of an allow AllowCondition.
The content of a join rule event.