File: room_event_by_timestamp.cpp

package info (click to toggle)
libquotient 0.9.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,588 kB
  • sloc: xml: 39,103; cpp: 25,226; sh: 97; makefile: 10
file content (31 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN

#include "room_event_by_timestamp.h"

using namespace Quotient;

auto queryToGetEventByTimestamp(int ts, const QString& dir)
{
    QUrlQuery _q;
    addParam(_q, u"ts"_s, ts);
    addParam(_q, u"dir"_s, dir);
    return _q;
}

QUrl GetEventByTimestampJob::makeRequestUrl(const HomeserverData& hsData, const QString& roomId,
                                            int ts, const QString& dir)
{
    return BaseJob::makeRequestUrl(hsData,
                                   makePath("/_matrix/client/v1", "/rooms/", roomId,
                                            "/timestamp_to_event"),
                                   queryToGetEventByTimestamp(ts, dir));
}

GetEventByTimestampJob::GetEventByTimestampJob(const QString& roomId, int ts, const QString& dir)
    : BaseJob(HttpVerb::Get, u"GetEventByTimestampJob"_s,
              makePath("/_matrix/client/v1", "/rooms/", roomId, "/timestamp_to_event"),
              queryToGetEventByTimestamp(ts, dir))
{
    addExpectedKey(u"event_id"_s);
    addExpectedKey(u"origin_server_ts"_s);
}