]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/rscript/rscript.cpp
More subscriptions, less notifiers.
[stg.git] / projects / stargazer / plugins / other / rscript / rscript.cpp
index 7f0f4bc4d74f4618738b7af9173b81f24f7df6a8..f8dc9d99bed486b8f2cee38b45a4d96fdbbb3d21 100644 (file)
@@ -160,8 +160,6 @@ REMOTE_SCRIPT::REMOTE_SCRIPT()
       isRunning(false),
       users(nullptr),
       sock(0),
-      onAddUserNotifier(*this),
-      onDelUserNotifier(*this),
       logger(STG::PluginLogger::get("rscript"))
 {
 }
@@ -201,8 +199,8 @@ netRouters = rsSettings.GetSubnetsMap();
 
 InitEncrypt(rsSettings.GetPassword());
 
-users->AddNotifierUserAdd(&onAddUserNotifier);
-users->AddNotifierUserDel(&onDelUserNotifier);
+m_onAddUserConn = users->onAdd([this](auto user){ AddUser(user); });
+m_onDelUserConn = users->onDel([this](auto user){ DelUser(user); });
 
 if (GetUsers())
     return -1;
@@ -242,9 +240,6 @@ if (isRunning)
         }
     }
 
-users->DelNotifierUserDel(&onDelUserNotifier);
-users->DelNotifierUserAdd(&onAddUserNotifier);
-
 if (isRunning)
     {
     logger("Cannot stop thread.");