diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-07-06 00:24:31 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-07-06 00:24:31 +0200 |
commit | 6c180a5ca3323ca276a9170b573dbb6a1fcae55b (patch) | |
tree | 3a6cdf0e8695b60c82ecbbcd7c2efecb90d1ef3c /src | |
parent | Fix overflow in event expiration days (diff) | |
download | nheko-6c180a5ca3323ca276a9170b573dbb6a1fcae55b.tar.xz |
Prevent redactions of ACL and Create events, since Synapse prevents redaction of them anyway
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp index 26e894b9..9001bd2d 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -1720,6 +1720,15 @@ utils::removeExpiredEvents() mtx::events::StateEvent<mtx::events::msg::Redacted>>(e)) continue; + // synapse protects these 2 against redaction + if (std::holds_alternative< + mtx::events::StateEvent<mtx::events::state::Create>>(e)) + continue; + + if (std::holds_alternative< + mtx::events::StateEvent<mtx::events::state::ServerAcl>>(e)) + continue; + // skip events we don't know to protect us from mistakes. if (std::holds_alternative< mtx::events::RoomEvent<mtx::events::Unknown>>(e)) @@ -1746,7 +1755,7 @@ utils::removeExpiredEvents() .emplace(to_string(se.type), se.state_key) .second; else - return false; + return true; }, e)) continue; |