summaryrefslogtreecommitdiff
path: root/src/RpcMethodFactory.cc
diff options
context:
space:
mode:
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