From f12e09ea1b45be1a96533aa83f6227940c70d548 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 16 Nov 2017 14:03:55 +0900 Subject: 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. --- events/event.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'events') 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 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(contentParams)...) { -- cgit v1.2.3