diff options
Diffstat (limited to 'lib/csapi/event_context.cpp')
-rw-r--r-- | lib/csapi/event_context.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/csapi/event_context.cpp b/lib/csapi/event_context.cpp index d2a5f522..877838e2 100644 --- a/lib/csapi/event_context.cpp +++ b/lib/csapi/event_context.cpp @@ -4,13 +4,11 @@ #include "event_context.h" -#include <QtCore/QStringBuilder> - using namespace Quotient; auto queryToGetEventContext(Omittable<int> limit, const QString& filter) { - BaseJob::Query _q; + QUrlQuery _q; addParam<IfNotEmpty>(_q, QStringLiteral("limit"), limit); addParam<IfNotEmpty>(_q, QStringLiteral("filter"), filter); return _q; @@ -22,9 +20,8 @@ QUrl GetEventContextJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& filter) { return BaseJob::makeRequestUrl(std::move(baseUrl), - QStringLiteral("/_matrix/client/r0") - % "/rooms/" % roomId % "/context/" - % eventId, + makePath("/_matrix/client/r0", "/rooms/", + roomId, "/context/", eventId), queryToGetEventContext(limit, filter)); } @@ -33,7 +30,7 @@ GetEventContextJob::GetEventContextJob(const QString& roomId, Omittable<int> limit, const QString& filter) : BaseJob(HttpVerb::Get, QStringLiteral("GetEventContextJob"), - QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId - % "/context/" % eventId, + makePath("/_matrix/client/r0", "/rooms/", roomId, "/context/", + eventId), queryToGetEventContext(limit, filter)) {} |