aboutsummaryrefslogtreecommitdiff
path: root/events/event.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-19 18:08:57 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-19 18:08:57 +0900
commit35ef29ead1da906e4978dcd908e7c1513ac9bfd3 (patch)
tree0e784f13ec837b9dd6f40e07423e0a3eb8012256 /events/event.cpp
parentc5c26ff4a09eecaa6d8e1507087566ccf0fd96b4 (diff)
parent0b11b06379fe668063ea5658a261f53f1dcf117a (diff)
downloadlibquotient-35ef29ead1da906e4978dcd908e7c1513ac9bfd3.tar.gz
libquotient-35ef29ead1da906e4978dcd908e7c1513ac9bfd3.zip
Merge branch 'master' into cache-state-to-json
Diffstat (limited to 'events/event.cpp')
-rw-r--r--events/event.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/events/event.cpp b/events/event.cpp
index 8a6de822..d718306d 100644
--- a/events/event.cpp
+++ b/events/event.cpp
@@ -48,6 +48,11 @@ QByteArray Event::originalJson() const
return QJsonDocument(_originalJson).toJson();
}
+QJsonObject Event::originalJsonObject() const
+{
+ return _originalJson;
+}
+
QDateTime Event::toTimestamp(const QJsonValue& v)
{
Q_ASSERT(v.isDouble() || v.isNull() || v.isUndefined());
@@ -97,21 +102,21 @@ RoomEvent::RoomEvent(Type type, const QJsonObject& rep)
, _senderId(rep["sender"].toString())
, _txnId(rep["unsigned"].toObject().value("transactionId").toString())
{
- if (_id.isEmpty())
- {
- qCWarning(EVENTS) << "Can't find event_id in a room event";
- qCWarning(EVENTS) << formatJson << rep;
- }
- if (!rep.contains("origin_server_ts"))
- {
- qCWarning(EVENTS) << "Can't find server timestamp in a room event";
- qCWarning(EVENTS) << formatJson << rep;
- }
- if (_senderId.isEmpty())
- {
- qCWarning(EVENTS) << "Can't find sender in a room event";
- qCWarning(EVENTS) << formatJson << rep;
- }
+// if (_id.isEmpty())
+// {
+// qCWarning(EVENTS) << "Can't find event_id in a room event";
+// qCWarning(EVENTS) << formatJson << rep;
+// }
+// if (!rep.contains("origin_server_ts"))
+// {
+// qCWarning(EVENTS) << "Can't find server timestamp in a room event";
+// qCWarning(EVENTS) << formatJson << rep;
+// }
+// if (_senderId.isEmpty())
+// {
+// qCWarning(EVENTS) << "Can't find sender in a room event";
+// qCWarning(EVENTS) << formatJson << rep;
+// }
if (!_txnId.isEmpty())
qCDebug(EVENTS) << "Event transactionId:" << _txnId;
}