]> jfr.im git - irc/rizon/znc.git/commitdiff
Allow controlpanel to load network modules on users
authorAdam <redacted>
Sat, 12 Jan 2013 21:41:29 +0000 (16:41 -0500)
committerAdam <redacted>
Sat, 12 Jan 2013 21:41:29 +0000 (16:41 -0500)
modules/controlpanel.cpp

index 905f6a1641a9ddac77a4dfc47cbee1f2236df91c..1452adcb2fceb4227ec80d6bce646ae344d5c3bf 100644 (file)
@@ -1000,7 +1000,11 @@ class CAdminMod : public CModule {
                CModule *pMod = (pUser)->GetModules().FindModule(sModName);
                if (!pMod) {
                        if (!(pUser)->GetModules().LoadModule(sModName, sArgs, CModInfo::UserModule, pUser, NULL, sModRet)) {
-                               PutModule("Unable to load module [" + sModName + "] [" + sModRet + "]");
+                               if (pUser->GetNetworks().size() && !(pUser)->GetModules().LoadModule(sModName, sArgs, CModInfo::NetworkModule, pUser, pUser->GetNetworks().front(), sModRet))
+                                       PutModule("Unable to load module [" + sModName + "] [" + sModRet + "]");
+                               else
+                                       PutModule("Loaded module [" + sModName + "] (" + pUser->GetNetworks().front()->GetName() + ")");
+
                        } else {
                                PutModule("Loaded module [" + sModName + "]");
                        }