From d3f16a5711f6d4131c13f548efd3d22d9fac7952 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 8 Apr 2016 13:06:32 +0200 Subject: system.listNotifications RPC method --- src/RpcMethodFactory.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/RpcMethodFactory.cc') diff --git a/src/RpcMethodFactory.cc b/src/RpcMethodFactory.cc index 2b1ce98c..82579b9e 100644 --- a/src/RpcMethodFactory.cc +++ b/src/RpcMethodFactory.cc @@ -68,11 +68,24 @@ std::vector rpcMethodNames = { "aria2.removeDownloadResult", "aria2.getVersion", "aria2.getSessionInfo", "aria2.shutdown", "aria2.forceShutdown", "aria2.getGlobalStat", "aria2.saveSession", "system.multicall", "system.listMethods", + "system.listNotifications", }; } // namespace const std::vector& allMethodNames() { return rpcMethodNames; } +namespace { +std::vector rpcNotificationsNames = { + "aria2.onDownloadStart", "aria2.onDownloadPause", "aria2.onDownloadStop", + "aria2.onDownloadComplete", "aria2.onDownloadError", + #ifdef ENABLE_BITTORRENT + "aria2.onBtDownloadComplete", + #endif // ENABLE_BITTORRENT +}; +} // namespace + +const std::vector& allNotificationsNames() { return rpcNotificationsNames; } + namespace { std::unique_ptr createMethod(const std::string& methodName) { @@ -220,6 +233,10 @@ std::unique_ptr createMethod(const std::string& methodName) return make_unique(); } + if (methodName == SystemListNotificationsRpcMethod::getMethodName()) { + return make_unique(); + } + return nullptr; } } // namespace -- cgit