diff --git a/Modules.cpp b/Modules.cpp index a5ec25e7..05fc3fcb 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -144,7 +144,6 @@ CModule::~CModule() { void CModule::SetUser(CUser* pUser) { m_pUser = pUser; } void CModule::SetClient(CClient* pClient) { m_pClient = pClient; } -void CModule::Unload() const { throw UNLOAD; } bool CModule::LoadRegistry() { //CString sPrefix = (m_pUser) ? m_pUser->GetUserName() : ".global"; @@ -247,7 +246,7 @@ bool CModule::UnlinkTimer(CTimer* pTimer) { return false; } -CTimer* CModule::FindTimer(const CString& sLabel) const { +CTimer* CModule::FindTimer(const CString& sLabel) { set::iterator it; for (it = m_sTimers.begin(); it != m_sTimers.end(); ++it) { CTimer* pTimer = *it; @@ -335,7 +334,7 @@ bool CModule::UnlinkSocket(CSocket* pSocket) { return false; } -CSocket* CModule::FindSocket(const CString& sSockName) const { +CSocket* CModule::FindSocket(const CString& sSockName) { set::iterator it; for (it = m_sSockets.begin(); it != m_sSockets.end(); ++it) { CSocket* pSocket = *it; @@ -456,7 +455,6 @@ CModule::EModRet CModule::OnChanNotice(CNick& Nick, CChan& Channel, CString& sMe CModule::EModRet CModule::OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) { return CONTINUE; } CModule::EModRet CModule::OnTimerAutoJoin(CChan& Channel) { return CONTINUE; } -ModHandle CModule::GetDLL() const { return m_pDLL; } bool CModule::PutIRC(const CString& sLine) { return (m_pUser) ? m_pUser->PutIRC(sLine) : false; } diff --git a/Modules.h b/Modules.h index 49c1caa3..bab1cbb0 100644 --- a/Modules.h +++ b/Modules.h @@ -255,7 +255,7 @@ public: /** This function throws CModule::UNLOAD which causes this module to be unloaded. */ - void Unload() const; + void Unload() { throw UNLOAD; } /** This module hook is called when a module is loaded * @param sArgsi The arguments for the modules. @@ -645,7 +645,7 @@ public: */ virtual EModRet OnTimerAutoJoin(CChan& Channel); - ModHandle GetDLL() const; + ModHandle GetDLL() { return m_pDLL; } static double GetCoreVersion() { return VERSION; } /** This function sends a given raw IRC line to the IRC server, if we @@ -716,7 +716,7 @@ public: bool RemTimer(CTimer* pTimer); bool RemTimer(const CString& sLabel); bool UnlinkTimer(CTimer* pTimer); - CTimer* FindTimer(const CString& sLabel) const; + CTimer* FindTimer(const CString& sLabel); set::const_iterator BeginTimers() const { return m_sTimers.begin(); } set::const_iterator EndTimers() const { return m_sTimers.end(); } virtual void ListTimers(); @@ -727,7 +727,7 @@ public: bool RemSocket(CSocket* pSocket); bool RemSocket(const CString& sSockName); bool UnlinkSocket(CSocket* pSocket); - CSocket* FindSocket(const CString& sSockName) const; + CSocket* FindSocket(const CString& sSockName); set::const_iterator BeginSockets() const { return m_sSockets.begin(); } set::const_iterator EndSockets() const { return m_sSockets.end(); } virtual void ListSockets(); @@ -764,12 +764,12 @@ public: * except when we are in a user-specific module hook in which * case this is the user pointer. */ - CUser* GetUser() const { return m_pUser; } + CUser* GetUser() { return m_pUser; } /** @returns NULL except when we are in a client-specific module hook in * which case this is the client for which the hook is called. */ - CClient* GetClient() const { return m_pClient; } - CSockManager* GetManager() const { return m_pManager; } + CClient* GetClient() { return m_pClient; } + CSockManager* GetManager() { return m_pManager; } // !Getters protected: diff --git a/User.cpp b/User.cpp index 5f105562..aa8e5879 100644 --- a/User.cpp +++ b/User.cpp @@ -1175,7 +1175,7 @@ bool CUser::SetBufferCount(unsigned int u, bool bForce) { return true; } -void CUser::CheckIRCConnect() const { +void CUser::CheckIRCConnect() { // Do we want to connect? if (m_bIRCConnectEnabled && GetIRCSock() == NULL) CZNC::Get().EnableConnectUser(); diff --git a/User.h b/User.h index 6a621e13..44304911 100644 --- a/User.h +++ b/User.h @@ -111,7 +111,7 @@ public: bool IsIRCConnected() const { return GetIRCSock() != NULL; } void IRCConnected(CIRCSock* pIRCSock); void IRCDisconnected(); - void CheckIRCConnect() const; + void CheckIRCConnect(); void AddDCCBounce(CDCCBounce* p) { m_sDCCBounces.insert(p); } void DelDCCBounce(CDCCBounce* p) { m_sDCCBounces.erase(p); }