summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-08 11:35:09 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-08 11:35:27 +0200
commit8784156da5abf82c890a4a53c5e03940b14617d3 (patch)
tree672ddb50a3380ee6fd1304f6e38df29418401555 /src
parentincrease settings window size (diff)
downloadnheko-8784156da5abf82c890a4a53c5e03940b14617d3.tar.xz
Fix trying to delete unsupported events
Diffstat (limited to 'src')
-rw-r--r--src/Cache_p.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h

index 30c365a6..51fe9978 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h
@@ -414,24 +414,25 @@ private: if constexpr (isStateEvent_<decltype(e)>) { eventsDb.put(txn, e.event_id, json(e).dump()); - if (std::is_same_v< - std::remove_cv_t<std::remove_reference_t<decltype(e)>>, - StateEvent<mtx::events::msg::Redacted>>) { - if (e.type == EventType::RoomMember) - membersdb.del(txn, e.state_key, ""); - else if (e.state_key.empty()) - statesdb.del(txn, to_string(e.type)); - else - stateskeydb.del( - txn, - to_string(e.type), - json::object({ - {"key", e.state_key}, - {"id", e.event_id}, - }) - .dump()); - } else if (e.type != EventType::Unsupported) { - if (e.state_key.empty()) + if (e.type != EventType::Unsupported) { + if (std::is_same_v< + std::remove_cv_t< + std::remove_reference_t<decltype(e)>>, + StateEvent<mtx::events::msg::Redacted>>) { + if (e.type == EventType::RoomMember) + membersdb.del(txn, e.state_key, ""); + else if (e.state_key.empty()) + statesdb.del(txn, to_string(e.type)); + else + stateskeydb.del( + txn, + to_string(e.type), + json::object({ + {"key", e.state_key}, + {"id", e.event_id}, + }) + .dump()); + } else if (e.state_key.empty()) statesdb.put( txn, to_string(e.type), json(e).dump()); else