aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-11 19:24:38 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-11 19:24:38 +0900
commit71185be83b646c7d5a2d6d3dc0306710e1f6fdd0 (patch)
treef8a12212dd14db285f992d0be7ffc6112e1c3d40
parent5a5ae02e1eb9d58b162d8e3c0b3f837a6719d38f (diff)
downloadlibquotient-71185be83b646c7d5a2d6d3dc0306710e1f6fdd0.tar.gz
libquotient-71185be83b646c7d5a2d6d3dc0306710e1f6fdd0.zip
Whitelist origin_server_ts in redaction logic
The Spec doesn't mention it but both Synapse and Riot act as if origin_server_ts was whitelisted, and it was also confirmed in #matrix-dev to be reasonable behaviour.
-rw-r--r--events/event.cpp4
-rw-r--r--room.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/events/event.cpp b/events/event.cpp
index d779f293..354aed03 100644
--- a/events/event.cpp
+++ b/events/event.cpp
@@ -87,6 +87,8 @@ RoomEvent::RoomEvent(Event::Type type) : Event(type) { }
RoomEvent::RoomEvent(Type type, const QJsonObject& rep)
: Event(type, rep), _id(rep["event_id"].toString())
, _roomId(rep["room_id"].toString())
+ , _serverTimestamp(
+ QMatrixClient::fromJson<QDateTime>(rep["origin_server_ts"]))
, _senderId(rep["sender"].toString())
{
// if (_id.isEmpty())
@@ -112,8 +114,6 @@ RoomEvent::RoomEvent(Type type, const QJsonObject& rep)
return;
}
- _serverTimestamp =
- QMatrixClient::fromJson<QDateTime>(rep["origin_server_ts"]);
_txnId = unsignedData.value("transactionId").toString();
if (!_txnId.isEmpty())
qCDebug(EVENTS) << "Event transactionId:" << _txnId;
diff --git a/room.cpp b/room.cpp
index dfca6bde..7f4d7684 100644
--- a/room.cpp
+++ b/room.cpp
@@ -716,7 +716,7 @@ void Room::Private::processRedaction(const RedactionEvent* redaction)
}
static const QStringList keepKeys =
{ "event_id", "type", "room_id", "sender", "state_key",
- "prev_content", "content" };
+ "prev_content", "content", "origin_server_ts" };
static const
std::vector<std::pair<EventType, QStringList>> keepContentKeysMap
{ { Event::Type::RoomMember, { "membership" } }