From aac349a2b3fe643b55808586f461642ea15da8e5 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jul 2022 13:12:52 +0200 Subject: Don't redact certain event types even though lib doesn't know them Event type ids don't need a C++ type to be used, and clients might define those types on their side (NeoChat does that, e.g.). --- lib/room.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/room.cpp') diff --git a/lib/room.cpp b/lib/room.cpp index b128d2a7..53474c24 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2640,10 +2640,11 @@ RoomEventPtr makeRedacted(const RoomEvent& target, { QStringLiteral("ban"), QStringLiteral("events"), QStringLiteral("events_default"), QStringLiteral("kick"), QStringLiteral("redact"), QStringLiteral("state_default"), - QStringLiteral("users"), QStringLiteral("users_default") } } - // , { RoomJoinRules::typeId(), { QStringLiteral("join_rule") } } - // , { RoomHistoryVisibility::typeId(), - // { QStringLiteral("history_visibility") } } + QStringLiteral("users"), QStringLiteral("users_default") } }, + // TODO: Replace with RoomJoinRules::TypeId etc. once available + { "m.room.join_rules"_ls, { QStringLiteral("join_rule") } }, + { "m.room.history_visibility"_ls, + { QStringLiteral("history_visibility") } } }; for (auto it = originalJson.begin(); it != originalJson.end();) { if (!keepKeys.contains(it.key())) -- cgit v1.2.3