aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-16 14:03:55 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-16 14:03:55 +0900
commitf12e09ea1b45be1a96533aa83f6227940c70d548 (patch)
tree456dc7632ec81c05786bd7ac88934b49a2d4e2c3 /events
parente8ced4bb607084a3771f853bd7dcb6a4396aef59 (diff)
downloadlibquotient-f12e09ea1b45be1a96533aa83f6227940c70d548.tar.gz
libquotient-f12e09ea1b45be1a96533aa83f6227940c70d548.zip
Require state_key to be present in all state events
This impacts the cache as well, as we don't save state_keys for most state events.
Diffstat (limited to 'events')
-rw-r--r--events/event.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/events/event.h b/events/event.h
index 9c915e35..c0c1b603 100644
--- a/events/event.h
+++ b/events/event.h
@@ -159,7 +159,8 @@ namespace QMatrixClient
template <typename... ContentParamTs>
explicit StateEvent(Type type, const QJsonObject& obj,
ContentParamTs&&... contentParams)
- : RoomEvent(type, obj)
+ : RoomEvent(obj.contains("state_key") ? type : Type::Unknown,
+ obj)
, _content(contentJson(),
std::forward<ContentParamTs>(contentParams)...)
{