10 namespace EventContent {
11 struct AliasesEventContent {
12 QString canonicalAlias;
13 QStringList altAliases;
18 inline EventContent::AliasesEventContent fromJson(
const QJsonObject& jo)
20 return EventContent::AliasesEventContent {
21 fromJson<QString>(jo[
"alias"_L1]),
22 fromJson<QStringList>(jo[
"alt_aliases"_L1])
26 inline auto toJson(
const EventContent::AliasesEventContent& c)
29 addParam<IfNotEmpty>(jo,
"alias"_L1, c.canonicalAlias);
30 addParam<IfNotEmpty>(jo,
"alt_aliases"_L1, c.altAliases);
35 :
public KeylessStateEventBase<RoomCanonicalAliasEvent,
36 EventContent::AliasesEventContent> {
38 QUO_EVENT(RoomCanonicalAliasEvent,
"m.room.canonical_alias")
39 using KeylessStateEventBase::KeylessStateEventBase;
41 QString alias()
const {
return content().canonicalAlias; }
42 QStringList altAliases()
const {
return content().altAliases; }