Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
37df8236
Verified
Commit
37df8236
authored
5 years ago
by
Joe Donofry
Browse files
Options
Downloads
Patches
Plain Diff
Add 'from' and 'only' params to notifications endpoint
parent
35b596a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/mtxclient/http/client.hpp
+4
-1
4 additions, 1 deletion
include/mtxclient/http/client.hpp
lib/http/client.cpp
+12
-1
12 additions, 1 deletion
lib/http/client.cpp
with
16 additions
and
2 deletions
include/mtxclient/http/client.hpp
+
4
−
1
View file @
37df8236
...
...
@@ -167,7 +167,10 @@ public:
//! Paginate through the list of events that the user has been,
//! or would have been notified about.
void
notifications
(
uint64_t
limit
,
Callback
<
mtx
::
responses
::
Notifications
>
cb
);
void
notifications
(
uint64_t
limit
,
const
std
::
string
&
from
,
const
std
::
string
&
only
,
Callback
<
mtx
::
responses
::
Notifications
>
cb
);
//! Perform logout.
void
logout
(
Callback
<
mtx
::
responses
::
Logout
>
cb
);
...
...
This diff is collapsed.
Click to expand it.
lib/http/client.cpp
+
12
−
1
View file @
37df8236
...
...
@@ -151,11 +151,22 @@ Client::logout(Callback<mtx::responses::Logout> callback)
}
void
Client
::
notifications
(
uint64_t
limit
,
Callback
<
mtx
::
responses
::
Notifications
>
cb
)
Client
::
notifications
(
uint64_t
limit
,
const
std
::
string
&
from
,
const
std
::
string
&
only
,
Callback
<
mtx
::
responses
::
Notifications
>
cb
)
{
std
::
map
<
std
::
string
,
std
::
string
>
params
;
params
.
emplace
(
"limit"
,
std
::
to_string
(
limit
));
if
(
!
from
.
empty
())
{
params
.
emplace
(
"from"
,
from
);
}
if
(
!
only
.
empty
())
{
params
.
emplace
(
"only"
,
only
);
}
get
<
mtx
::
responses
::
Notifications
>
(
"/client/r0/notifications?"
+
mtx
::
client
::
utils
::
query_params
(
params
),
[
cb
](
const
mtx
::
responses
::
Notifications
&
res
,
HeaderFields
,
RequestErr
err
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment