aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/receiptevent.cpp6
-rw-r--r--events/receiptevent.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp
index 646bb989..b36ddb23 100644
--- a/events/receiptevent.cpp
+++ b/events/receiptevent.cpp
@@ -35,10 +35,9 @@ Example of a Receipt Event:
#include "receiptevent.h"
+#include "converters.h"
#include "logging.h"
-#include <QtCore/QJsonArray>
-
using namespace QMatrixClient;
ReceiptEvent::ReceiptEvent(const QJsonObject& obj)
@@ -62,7 +61,8 @@ ReceiptEvent::ReceiptEvent(const QJsonObject& obj)
for( auto userIt = reads.begin(); userIt != reads.end(); ++userIt )
{
const QJsonObject user = userIt.value().toObject();
- receipts.push_back({userIt.key(), toTimestamp(user["ts"])});
+ receipts.push_back({userIt.key(),
+ QMatrixClient::fromJson<QDateTime>(user["ts"])});
}
_eventsWithReceipts.push_back({eventIt.key(), receipts});
}
diff --git a/events/receiptevent.h b/events/receiptevent.h
index cbe36b10..15fdf946 100644
--- a/events/receiptevent.h
+++ b/events/receiptevent.h
@@ -43,6 +43,8 @@ namespace QMatrixClient
{ return _eventsWithReceipts; }
bool unreadMessages() const { return _unreadMessages; }
+ static constexpr const char* const TypeId = "m.receipt";
+
private:
EventsWithReceipts _eventsWithReceipts;
bool _unreadMessages; // Spec extension for caching purposes