diff options
| author | Sonny Piers <sonny@fastmail.net> | 2016-04-08 13:06:32 +0200 |
|---|---|---|
| committer | Sonny Piers <sonny@fastmail.net> | 2016-04-08 18:09:50 +0200 |
| commit | d3f16a5711f6d4131c13f548efd3d22d9fac7952 (patch) | |
| tree | a82039925cff57493e2ac873b0bcb0c2550c0d3d /src/RpcMethodImpl.cc | |
| parent | 9c04cb29957002b7ecef20feed93726b386b8a21 (diff) | |
system.listNotifications RPC method
Diffstat (limited to 'src/RpcMethodImpl.cc')
| -rw-r--r-- | src/RpcMethodImpl.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index a1c5770f..d727501c 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -1451,6 +1451,26 @@ RpcResponse SystemListMethodsRpcMethod::execute(RpcRequest req, std::move(req.id)); } +std::unique_ptr<ValueBase> +SystemListNotificationsRpcMethod::process(const RpcRequest& req, + DownloadEngine* e) +{ + auto list = List::g(); + for (auto& s : allNotificationsNames()) { + list->append(s); + } + + return std::move(list); +} + +RpcResponse SystemListNotificationsRpcMethod::execute(RpcRequest req, + DownloadEngine* e) +{ + auto r = process(req, e); + return RpcResponse(0, RpcResponse::AUTHORIZED, std::move(r), + std::move(req.id)); +} + std::unique_ptr<ValueBase> NoSuchMethodRpcMethod::process(const RpcRequest& req, DownloadEngine* e) { |
