Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F325618
message_pagination.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
message_pagination.cpp
View Options
/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#include
<algorithm>
#include
"message_pagination.hpp"
namespace
Kazv
{
BaseJob
::
Query
GetRoomEventsJob::buildQuery
(
std
::
string
from
,
std
::
optional
<
std
::
string
>
to
,
std
::
string
dir
,
std
::
optional
<
int
>
limit
,
std
::
optional
<
std
::
string
>
filter
)
{
BaseJob
::
Query
_q
;
addToQuery
(
_q
,
"from"
s
,
from
);
addToQueryIfNeeded
(
_q
,
"to"
s
,
to
);
addToQuery
(
_q
,
"dir"
s
,
dir
);
addToQueryIfNeeded
(
_q
,
"limit"
s
,
limit
);
addToQueryIfNeeded
(
_q
,
"filter"
s
,
filter
);
return
_q
;
}
BaseJob
::
Body
GetRoomEventsJob::buildBody
(
std
::
string
roomId
,
std
::
string
from
,
std
::
string
dir
,
std
::
optional
<
std
::
string
>
to
,
std
::
optional
<
int
>
limit
,
std
::
optional
<
std
::
string
>
filter
)
{
// ignore unused param
(
void
)(
roomId
);(
void
)(
from
);(
void
)(
dir
);(
void
)(
to
);(
void
)(
limit
);(
void
)(
filter
);
return
BaseJob
::
EmptyBody
{};
};
GetRoomEventsJob
::
GetRoomEventsJob
(
std
::
string
serverUrl
,
std
::
string
_accessToken
,
std
::
string
roomId
,
std
::
string
from
,
std
::
string
dir
,
std
::
optional
<
std
::
string
>
to
,
std
::
optional
<
int
>
limit
,
std
::
optional
<
std
::
string
>
filter
)
:
BaseJob
(
std
::
move
(
serverUrl
),
std
::
string
(
"/_matrix/client/r0"
)
+
"/rooms/"
+
roomId
+
"/messages"
,
GET
,
std
::
string
(
"GetRoomEvents"
),
_accessToken
,
ReturnType
::
Json
,
buildBody
(
roomId
,
from
,
dir
,
to
,
limit
,
filter
)
,
buildQuery
(
from
,
to
,
dir
,
limit
,
filter
)
)
{
}
GetRoomEventsJob
GetRoomEventsJob
::
withData
(
JsonWrap
j
)
&&
{
auto
ret
=
GetRoomEventsJob
(
std
::
move
(
*
this
));
ret
.
attachData
(
j
);
return
ret
;
}
GetRoomEventsJob
GetRoomEventsJob
::
withData
(
JsonWrap
j
)
const
&
{
auto
ret
=
GetRoomEventsJob
(
*
this
);
ret
.
attachData
(
j
);
return
ret
;
}
GetRoomEventsJob
::
JobResponse
::
JobResponse
(
Response
r
)
:
Response
(
std
::
move
(
r
))
{}
bool
GetRoomEventsResponse
::
success
()
const
{
return
Response
::
success
()
&&
isBodyJson
(
body
)
;
}
std
::
optional
<
std
::
string
>
GetRoomEventsResponse
::
start
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"start"
s
))
{
return
jsonBody
().
get
()[
"start"
s
]
/*.get<std::string>()*/
;}
else
{
return
std
::
optional
<
std
::
string
>
(
);}
}
std
::
optional
<
std
::
string
>
GetRoomEventsResponse
::
end
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"end"
s
))
{
return
jsonBody
().
get
()[
"end"
s
]
/*.get<std::string>()*/
;}
else
{
return
std
::
optional
<
std
::
string
>
(
);}
}
EventList
GetRoomEventsResponse
::
chunk
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"chunk"
s
))
{
return
jsonBody
().
get
()[
"chunk"
s
]
/*.get<EventList>()*/
;}
else
{
return
EventList
(
);}
}
EventList
GetRoomEventsResponse
::
state
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"state"
s
))
{
return
jsonBody
().
get
()[
"state"
s
]
/*.get<EventList>()*/
;}
else
{
return
EventList
(
);}
}
}
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Thu, Apr 24, 4:18 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
101901
Default Alt Text
message_pagination.cpp (3 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment