diff --git a/Modules.cpp b/Modules.cpp index 68668e17..e7a9bd6e 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -437,8 +437,8 @@ void CModule::ListSockets() { } } -const CString& CModule::GetModName() { return m_sModName; } -CString CModule::GetModNick() { return ((m_pUser) ? m_pUser->GetStatusPrefix() : "*") + m_sModName; } +const CString& CModule::GetModName() const { return m_sModName; } +CString CModule::GetModNick() const { return ((m_pUser) ? m_pUser->GetStatusPrefix() : "*") + m_sModName; } bool CModule::OnLoad(const CString& sArgs) { return true; } bool CModule::OnBoot() { return true; } @@ -679,7 +679,7 @@ bool CGlobalModules::OnConfigLine(const CString& sName, const CString& sValue, C GLOBALMODHALTCHK(OnConfigLine(sName, sValue, pUser, pChan)); } -CModule* CModules::FindModule(const CString& sModule) { +CModule* CModules::FindModule(const CString& sModule) const { for (unsigned int a = 0; a < size(); a++) { if (sModule.CaseCmp((*this)[a]->GetModName()) == 0) { return (*this)[a]; diff --git a/Modules.h b/Modules.h index b867117f..42012f74 100644 --- a/Modules.h +++ b/Modules.h @@ -235,8 +235,8 @@ public: virtual bool PutModule(const CString& sLine, const CString& sIdent = "znc", const CString& sHost = "znc.com"); virtual bool PutModNotice(const CString& sLine, const CString& sIdent = "znc", const CString& sHost = "znc.com"); - const CString& GetModName(); - CString GetModNick(); + const CString& GetModName() const; + CString GetModNick() const; // Timer stuff bool AddTimer(CTimer* pTimer); @@ -344,7 +344,7 @@ public: virtual bool OnPrivNotice(const CNick& Nick, CString& sMessage); virtual bool OnChanNotice(const CNick& Nick, CChan& Channel, CString& sMessage); - CModule* FindModule(const CString& sModule); + CModule* FindModule(const CString& sModule) const; bool LoadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg); bool UnloadModule(const CString& sModule); bool UnloadModule(const CString& sModule, CString& sRetMsg);