diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-10 09:49:08 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-10 16:20:22 +0900 |
commit | 6ecdefd8463c0b393dc51535ddb4b4283b5891d8 (patch) | |
tree | 70cfe732adf08676246c4432b0f9076ad9392785 /events/roommessageevent.cpp | |
parent | c38366210643ef0956884531910d7ece3d6a4cac (diff) | |
download | libquotient-6ecdefd8463c0b393dc51535ddb4b4283b5891d8.tar.gz libquotient-6ecdefd8463c0b393dc51535ddb4b4283b5891d8.zip |
RedactionEvent and RoomEvent::redactedBecause()
A RoomEvent now has an optional pointer to a RedactionEvent that is non-null if the room event is redacted. transactionId and serverTimestamp are only filled if the event is not redacted. There's no way to construct a redacted event as of yet.
Diffstat (limited to 'events/roommessageevent.cpp')
-rw-r--r-- | events/roommessageevent.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp index f06474e9..bc41abf6 100644 --- a/events/roommessageevent.cpp +++ b/events/roommessageevent.cpp @@ -58,7 +58,6 @@ QString msgTypeToJson(MsgType enumType) if (it != msgTypes.end()) return it->jsonType; - qCCritical(EVENTS) << "Unknown msgtype:" << enumType; return {}; } @@ -69,8 +68,7 @@ MsgType jsonToMsgType(const QString& jsonType) if (it != msgTypes.end()) return it->enumType; - qCCritical(EVENTS) << "Unknown msgtype:" << jsonType; - return {}; + return MsgType::Unknown; } RoomMessageEvent::RoomMessageEvent(const QString& plainBody, @@ -81,6 +79,8 @@ RoomMessageEvent::RoomMessageEvent(const QString& plainBody, RoomMessageEvent::RoomMessageEvent(const QJsonObject& obj) : RoomEvent(Type::RoomMessage, obj), _content(nullptr) { + if (isRedacted()) + return; const QJsonObject content = contentJson(); if ( content.contains("msgtype") && content.contains("body") ) { |