aboutsummaryrefslogtreecommitdiff
path: root/lib/events/stateevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/stateevent.cpp')
-rw-r--r--lib/events/stateevent.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/events/stateevent.cpp b/lib/events/stateevent.cpp
index a84f302b..6a6e7782 100644
--- a/lib/events/stateevent.cpp
+++ b/lib/events/stateevent.cpp
@@ -27,7 +27,7 @@ using namespace QMatrixClient;
RoomEvent::factory_t::addMethod(
[] (const QJsonObject& json, const QString& matrixType) -> StateEventPtr
{
- if (!json.contains("state_key"_ls))
+ if (!json.contains(StateKeyKeyL))
return nullptr;
if (auto e = StateEventBase::factory_t::make(json, matrixType))
@@ -36,6 +36,12 @@ using namespace QMatrixClient;
return makeEvent<StateEventBase>(unknownEventTypeId(), json);
});
+StateEventBase::StateEventBase(Event::Type type, event_mtype_t matrixType,
+ const QString &stateKey,
+ const QJsonObject &contentJson)
+ : RoomEvent(type, basicStateEventJson(matrixType, contentJson, stateKey))
+{ }
+
bool StateEventBase::repeatsState() const
{
const auto prevContentJson = unsignedJson().value(PrevContentKeyL);