From 2931b4d13e1883150b92f80f08aa51d86ac2445f Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 1 Nov 2017 17:40:30 +0300 Subject: ReceiptEvent: Use fromJson<>() from converters.h; add TypeId Event::toTimestamp() duplicates fromJson<>() code, so it should go. --- events/receiptevent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'events/receiptevent.cpp') 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 - 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(user["ts"])}); } _eventsWithReceipts.push_back({eventIt.key(), receipts}); } -- cgit v1.2.3