aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/message_pagination.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/message_pagination.cpp')
-rw-r--r--lib/csapi/message_pagination.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/csapi/message_pagination.cpp b/lib/csapi/message_pagination.cpp
index 855c051f..0b2c99ce 100644
--- a/lib/csapi/message_pagination.cpp
+++ b/lib/csapi/message_pagination.cpp
@@ -4,16 +4,14 @@
#include "message_pagination.h"
-#include <QtCore/QStringBuilder>
-
using namespace Quotient;
auto queryToGetRoomEvents(const QString& from, const QString& to,
const QString& dir, Omittable<int> limit,
const QString& filter)
{
- BaseJob::Query _q;
- addParam<>(_q, QStringLiteral("from"), from);
+ QUrlQuery _q;
+ addParam<IfNotEmpty>(_q, QStringLiteral("from"), from);
addParam<IfNotEmpty>(_q, QStringLiteral("to"), to);
addParam<>(_q, QStringLiteral("dir"), dir);
addParam<IfNotEmpty>(_q, QStringLiteral("limit"), limit);
@@ -22,21 +20,23 @@ auto queryToGetRoomEvents(const QString& from, const QString& to,
}
QUrl GetRoomEventsJob::makeRequestUrl(QUrl baseUrl, const QString& roomId,
- const QString& from, const QString& dir,
+ const QString& dir, const QString& from,
const QString& to, Omittable<int> limit,
const QString& filter)
{
return BaseJob::makeRequestUrl(
std::move(baseUrl),
- QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId % "/messages",
+ makePath("/_matrix/client/v3", "/rooms/", roomId, "/messages"),
queryToGetRoomEvents(from, to, dir, limit, filter));
}
-GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& from,
- const QString& dir, const QString& to,
+GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& dir,
+ const QString& from, const QString& to,
Omittable<int> limit, const QString& filter)
: BaseJob(HttpVerb::Get, QStringLiteral("GetRoomEventsJob"),
- QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId
- % "/messages",
+ makePath("/_matrix/client/v3", "/rooms/", roomId, "/messages"),
queryToGetRoomEvents(from, to, dir, limit, filter))
-{}
+{
+ addExpectedKey("start");
+ addExpectedKey("chunk");
+}