aboutsummaryrefslogtreecommitdiff
path: root/events/event.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-05-25 19:45:15 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-05-26 10:47:44 +0900
commitfab6c26770827ce2b8ed8f5d06b3677b75a19cec (patch)
tree2487f1432c45829b152e7481077ad0fb08748aa6 /events/event.h
parent1cd8802c73ee3c0cc0095f8be30a9bbf3442c3ca (diff)
downloadlibquotient-fab6c26770827ce2b8ed8f5d06b3677b75a19cec.tar.gz
libquotient-fab6c26770827ce2b8ed8f5d06b3677b75a19cec.zip
Introducing EventList class + minor fix
Now you can parse a JSON array into a list of events with a one-liner. Also, fromMSecsSinceEpoch accepts a qint64, not quint64 - fixed the respective cast.
Diffstat (limited to 'events/event.h')
-rw-r--r--events/event.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/events/event.h b/events/event.h
index 6a8d0e89..a009aa99 100644
--- a/events/event.h
+++ b/events/event.h
@@ -25,6 +25,8 @@
#include <QtCore/QDateTime>
#include <QtCore/QJsonObject>
+class QJsonArray;
+
namespace QMatrixClient
{
enum class EventType
@@ -56,6 +58,8 @@ namespace QMatrixClient
Private* d;
};
+ QList<Event*> eventListFromJson(const QJsonArray& contents);
+
/**
* Finds a place in the timeline where a new event/message could be inserted.
* @return an iterator to an item with the earliest timestamp after