summaryrefslogtreecommitdiff
path: root/src/RpcMethodFactory.cc
diff options
context:
space:
mode:
authorSonny Piers <sonny@fastmail.net>2016-04-08 13:06:32 +0200
committerSonny Piers <sonny@fastmail.net>2016-04-08 18:09:50 +0200
commitd3f16a5711f6d4131c13f548efd3d22d9fac7952 (patch)
treea82039925cff57493e2ac873b0bcb0c2550c0d3d /src/RpcMethodFactory.cc
parent9c04cb29957002b7ecef20feed93726b386b8a21 (diff)
system.listNotifications RPC method
Diffstat (limited to 'src/RpcMethodFactory.cc')
-rw-r--r--src/RpcMethodFactory.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/RpcMethodFactory.cc b/src/RpcMethodFactory.cc
index 2b1ce98c..82579b9e 100644
--- a/src/RpcMethodFactory.cc
+++ b/src/RpcMethodFactory.cc
@@ -68,12 +68,25 @@ std::vector<std::string> 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<std::string>& allMethodNames() { return rpcMethodNames; }
namespace {
+std::vector<std::string> rpcNotificationsNames = {
+ "aria2.onDownloadStart", "aria2.onDownloadPause", "aria2.onDownloadStop",
+ "aria2.onDownloadComplete", "aria2.onDownloadError",
+ #ifdef ENABLE_BITTORRENT
+ "aria2.onBtDownloadComplete",
+ #endif // ENABLE_BITTORRENT
+};
+} // namespace
+
+const std::vector<std::string>& allNotificationsNames() { return rpcNotificationsNames; }
+
+namespace {
std::unique_ptr<RpcMethod> createMethod(const std::string& methodName)
{
if (methodName == AddUriRpcMethod::getMethodName()) {
@@ -220,6 +233,10 @@ std::unique_ptr<RpcMethod> createMethod(const std::string& methodName)
return make_unique<SystemListMethodsRpcMethod>();
}
+ if (methodName == SystemListNotificationsRpcMethod::getMethodName()) {
+ return make_unique<SystemListNotificationsRpcMethod>();
+ }
+
return nullptr;
}
} // namespace