From 3fbb7175116d4a2e6aee73015a72d65994c04361 Mon Sep 17 00:00:00 2001 From: prozacx Date: Mon, 18 Jul 2005 01:58:44 +0000 Subject: [PATCH] Added Set/GetArgs() for telling the args a mod was loaded with git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@437 726aef4b-f618-498e-8847-2d620e286838 --- Modules.cpp | 11 +---------- Modules.h | 4 +++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Modules.cpp b/Modules.cpp index e7a9bd6e..a4623c84 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -520,16 +520,6 @@ void CModules::UnloadAll() { } } -bool CModules::OnLoad(const CString& sArgs) { - for (unsigned int a = 0; a < size(); a++) { - if (!(*this)[a]->OnLoad(sArgs)) { - return false; - } - } - - return true; -} - bool CModules::OnBoot() { for (unsigned int a = 0; a < size(); a++) { if (!(*this)[a]->OnBoot()) { @@ -806,6 +796,7 @@ bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CUser* p return false; } + pModule->SetArgs(sArgs); sRetMsg = "Loaded module [" + sModule + "] [" + sModPath + "]"; return true; #endif // !_MODULES diff --git a/Modules.h b/Modules.h index 42012f74..cd7719dc 100644 --- a/Modules.h +++ b/Modules.h @@ -270,10 +270,12 @@ public: // Setters void SetDescription(const CString& s) { m_sDescription = s; } + void SetArgs(const CString& s) { m_sArgs = s; } // !Setters // Getters const CString& GetDescription() const { return m_sDescription; } + const CString& GetArgs() const { return m_sArgs; } CZNC* GetZNC() { return m_pZNC; } CUser* GetUser() { return m_pUser; } TSocketManager* GetManager() { return m_pManager; } @@ -289,6 +291,7 @@ protected: CZNC* m_pZNC; CString m_sModName; CString m_sSavePath; + CString m_sArgs; private: MCString m_mssRegistry; //!< way to save name/value pairs. Note there is no encryption involved in this }; @@ -302,7 +305,6 @@ public: void UnloadAll(); - virtual bool OnLoad(const CString& sArgs); // Return false to abort virtual bool OnBoot(); // Return false to abort virtual void OnUserAttached(); virtual void OnUserDetached();