mirror of
https://github.com/znc/znc.git
synced 2026-08-12 03:42:48 +02:00
const correctness fixes
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ void CChan::Reset() {
|
||||
ResetJoinTries();
|
||||
}
|
||||
|
||||
CConfig CChan::ToConfig() {
|
||||
CConfig CChan::ToConfig() const {
|
||||
CConfig config;
|
||||
|
||||
if (m_bHasBufferCountSet)
|
||||
|
||||
+1
-1
@@ -775,7 +775,7 @@ void CClient::PutIRC(const CString& sLine) {
|
||||
}
|
||||
}
|
||||
|
||||
CString CClient::GetFullName() {
|
||||
CString CClient::GetFullName() const {
|
||||
if (!m_pUser)
|
||||
return GetRemoteIP();
|
||||
if (!m_pNetwork)
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ void CHTTPSock::ReadLine(const CString& sData) {
|
||||
}
|
||||
}
|
||||
|
||||
CString CHTTPSock::GetRemoteIP() {
|
||||
CString CHTTPSock::GetRemoteIP() const {
|
||||
if (!m_sForwardedIP.empty()) {
|
||||
return m_sForwardedIP;
|
||||
}
|
||||
|
||||
+4
-4
@@ -305,7 +305,7 @@ void CIRCNetwork::DelServers() {
|
||||
m_vServers.clear();
|
||||
}
|
||||
|
||||
CString CIRCNetwork::GetNetworkPath() {
|
||||
CString CIRCNetwork::GetNetworkPath() const {
|
||||
CString sNetworkPath = m_pUser->GetUserPath() + "/networks/" + m_sName;
|
||||
|
||||
if (!CFile::Exists(sNetworkPath)) {
|
||||
@@ -455,7 +455,7 @@ bool CIRCNetwork::ParseConfig(CConfig *pConfig, CString& sError, bool bUpgrade)
|
||||
return true;
|
||||
}
|
||||
|
||||
CConfig CIRCNetwork::ToConfig() {
|
||||
CConfig CIRCNetwork::ToConfig() const {
|
||||
CConfig config;
|
||||
|
||||
if (!m_sNick.empty()) {
|
||||
@@ -487,7 +487,7 @@ CConfig CIRCNetwork::ToConfig() {
|
||||
}
|
||||
|
||||
// Modules
|
||||
CModules& Mods = GetModules();
|
||||
const CModules& Mods = GetModules();
|
||||
|
||||
if (!Mods.empty()) {
|
||||
for (unsigned int a = 0; a < Mods.size(); a++) {
|
||||
@@ -638,7 +638,7 @@ void CIRCNetwork::ClientDisconnected(CClient *pClient) {
|
||||
}
|
||||
}
|
||||
|
||||
CUser* CIRCNetwork::GetUser() {
|
||||
CUser* CIRCNetwork::GetUser() const {
|
||||
return m_pUser;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -859,7 +859,7 @@ bool CUser::IsValid(CString& sErrMsg, bool bSkipPass) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
CConfig CUser::ToConfig() {
|
||||
CConfig CUser::ToConfig() const {
|
||||
CConfig config;
|
||||
CConfig passConfig;
|
||||
|
||||
@@ -923,7 +923,7 @@ CConfig CUser::ToConfig() {
|
||||
}
|
||||
|
||||
// Modules
|
||||
CModules& Mods = GetModules();
|
||||
const CModules& Mods = GetModules();
|
||||
|
||||
if (!Mods.empty()) {
|
||||
for (unsigned int a = 0; a < Mods.size(); a++) {
|
||||
@@ -976,11 +976,11 @@ bool CUser::CheckPass(const CString& sPass) const {
|
||||
return (CClient*) CZNC::Get().GetManager().FindSockByName(sSockName);
|
||||
}*/
|
||||
|
||||
CString CUser::GetLocalDCCIP() {
|
||||
CString CUser::GetLocalDCCIP() const {
|
||||
if (!GetDCCBindHost().empty())
|
||||
return GetDCCBindHost();
|
||||
|
||||
for (vector<CIRCNetwork*>::iterator it = m_vIRCNetworks.begin(); it != m_vIRCNetworks.end(); ++it) {
|
||||
for (vector<CIRCNetwork*>::const_iterator it = m_vIRCNetworks.begin(); it != m_vIRCNetworks.end(); ++it) {
|
||||
CIRCNetwork *pNetwork = *it;
|
||||
CIRCSock* pIRCSock = pNetwork->GetIRCSock();
|
||||
if (pIRCSock) {
|
||||
@@ -1167,7 +1167,7 @@ bool CUser::SetStatusPrefix(const CString& s) {
|
||||
// !Setters
|
||||
|
||||
// Getters
|
||||
vector<CClient*> CUser::GetAllClients() {
|
||||
vector<CClient*> CUser::GetAllClients() const {
|
||||
vector<CClient*> vClients;
|
||||
|
||||
for (unsigned int a = 0; a < m_vIRCNetworks.size(); a++) {
|
||||
|
||||
Reference in New Issue
Block a user