diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-25 11:17:34 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-25 11:17:34 +0900 |
commit | 6636e46a2e9049f261b8a64cb6c1bf7c4f076c54 (patch) | |
tree | a55a7c33bd4031ae91ebbebfd94d31344654b901 /lib/room.cpp | |
parent | ccb94f4fde97ed7f10b69c6739da3b090c80a3a1 (diff) | |
download | libquotient-6636e46a2e9049f261b8a64cb6c1bf7c4f076c54.tar.gz libquotient-6636e46a2e9049f261b8a64cb6c1bf7c4f076c54.zip |
makeRedacted: update the list of preserved parts
Closes #256.
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index f9c899cb..7e7d8505 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -1889,22 +1889,29 @@ RoomEventPtr makeRedacted(const RoomEvent& target, const RedactionEvent& redaction) { auto originalJson = target.originalJsonObject(); - static const QStringList keepKeys = - { EventIdKey, TypeKey, QStringLiteral("room_id"), - QStringLiteral("sender"), QStringLiteral("state_key"), - QStringLiteral("prev_content"), ContentKey, - QStringLiteral("origin_server_ts") }; + static const QStringList keepKeys { + EventIdKey, TypeKey, QStringLiteral("room_id"), + QStringLiteral("sender"), QStringLiteral("state_key"), + QStringLiteral("prev_content"), ContentKey, + QStringLiteral("hashes"), QStringLiteral("signatures"), + QStringLiteral("depth"), QStringLiteral("prev_events"), + QStringLiteral("prev_state"), QStringLiteral("auth_events"), + QStringLiteral("origin"), QStringLiteral("origin_server_ts"), + QStringLiteral("membership") + }; std::vector<std::pair<Event::Type, QStringList>> keepContentKeysMap { { RoomMemberEvent::typeId(), { QStringLiteral("membership") } } - , { RoomCreateEvent::typeId(), { QStringLiteral("creator") } } + , { RoomCreateEvent::typeId(), { QStringLiteral("creator") } } // , { RoomJoinRules::typeId(), { QStringLiteral("join_rule") } } // , { RoomPowerLevels::typeId(), // { QStringLiteral("ban"), QStringLiteral("events"), // QStringLiteral("events_default"), QStringLiteral("kick"), // QStringLiteral("redact"), QStringLiteral("state_default"), // QStringLiteral("users"), QStringLiteral("users_default") } } - , { RoomAliasesEvent::typeId(), { QStringLiteral("alias") } } + , { RoomAliasesEvent::typeId(), { QStringLiteral("aliases") } } +// , { RoomHistoryVisibility::typeId(), +// { QStringLiteral("history_visibility") } } }; for (auto it = originalJson.begin(); it != originalJson.end();) { |