mirror of
https://github.com/znc/znc.git
synced 2026-05-08 06:14:40 +02:00
committed by
Alexey Sokolov
parent
4f40500383
commit
e69032af17
+1
-1
@@ -312,7 +312,7 @@ public:
|
||||
* @return true if item existed and was removed, false if it never existed
|
||||
*/
|
||||
bool RemItem(const K& Item) {
|
||||
return m_mItems.erase(Item);
|
||||
return (m_mItems.erase(Item) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
* @return An integer less than, equal to, or greater than zero if this
|
||||
* string smaller, equal.... to the given string.
|
||||
*/
|
||||
int CaseCmp(const CString& s, unsigned long uLen = CString::npos) const;
|
||||
int CaseCmp(const CString& s, CString::size_type uLen = CString::npos) const;
|
||||
/**
|
||||
* Compare this string case sensitively to some other string.
|
||||
* @param s The string to compare to.
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
* @return An integer less than, equal to, or greater than zero if this
|
||||
* string smaller, equal.... to the given string.
|
||||
*/
|
||||
int StrCmp(const CString& s, unsigned long uLen = CString::npos) const;
|
||||
int StrCmp(const CString& s, CString::size_type uLen = CString::npos) const;
|
||||
/**
|
||||
* Check if this string is equal to some other string.
|
||||
* @param s The string to compare to.
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
* @param uLen Number of characters to consider.
|
||||
* @return True if the strings are equal.
|
||||
*/
|
||||
bool Equals(const CString& s, bool bCaseSensitive = false, unsigned long uLen = CString::npos) const;
|
||||
bool Equals(const CString& s, bool bCaseSensitive = false, CString::size_type uLen = CString::npos) const;
|
||||
/**
|
||||
* Do a wildcard comparision between two strings.
|
||||
* For example, the following returns true:
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ public:
|
||||
// !MOTD
|
||||
|
||||
void AddServerThrottle(CString sName) { m_sConnectThrottle.AddItem(sName); }
|
||||
bool GetServerThrottle(CString sName) { return m_sConnectThrottle.GetItem(sName); }
|
||||
bool GetServerThrottle(CString sName) { bool *b = m_sConnectThrottle.GetItem(sName); return (b && *b); }
|
||||
|
||||
void AddNetworkToQueue(CIRCNetwork *pNetwork);
|
||||
std::list<CIRCNetwork*>& GetConnectionQueue() { return m_lpConnectQueue; }
|
||||
|
||||
+12
-10
@@ -321,19 +321,21 @@ public:
|
||||
bool CheckAutoOp(const CNick& Nick, CChan& Channel) {
|
||||
CAutoOpUser *pUser = FindUserByHost(Nick.GetHostMask(), Channel.GetName());
|
||||
|
||||
if (pUser) {
|
||||
if (pUser->GetUserKey().Equals("__NOKEY__")) {
|
||||
PutIRC("MODE " + Channel.GetName() + " +o " + Nick.GetNick());
|
||||
} else {
|
||||
// then insert this nick into the queue, the timer does the rest
|
||||
CString sNick = Nick.GetNick().AsLower();
|
||||
if (m_msQueue.find(sNick) == m_msQueue.end()) {
|
||||
m_msQueue[sNick] = "";
|
||||
}
|
||||
if (!pUser) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pUser->GetUserKey().Equals("__NOKEY__")) {
|
||||
PutIRC("MODE " + Channel.GetName() + " +o " + Nick.GetNick());
|
||||
} else {
|
||||
// then insert this nick into the queue, the timer does the rest
|
||||
CString sNick = Nick.GetNick().AsLower();
|
||||
if (m_msQueue.find(sNick) == m_msQueue.end()) {
|
||||
m_msQueue[sNick] = "";
|
||||
}
|
||||
}
|
||||
|
||||
return pUser;
|
||||
return true;
|
||||
}
|
||||
|
||||
void DelUser(const CString& sUser) {
|
||||
|
||||
+1
-1
@@ -478,7 +478,7 @@ public:
|
||||
return sCap.Equals("sasl");
|
||||
}
|
||||
|
||||
virtual void OnServerCapResult(const CString& sCap, const bool bSuccess) {
|
||||
virtual void OnServerCapResult(const CString& sCap, bool bSuccess) {
|
||||
if (sCap.Equals("sasl")) {
|
||||
if (bSuccess) {
|
||||
GetMechanismsString().Split(" ", m_Mechanisms);
|
||||
|
||||
+3
-3
@@ -65,21 +65,21 @@ unsigned char* CString::strnchr(const unsigned char* src, unsigned char c, unsig
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CString::CaseCmp(const CString& s, unsigned long uLen) const {
|
||||
int CString::CaseCmp(const CString& s, CString::size_type uLen) const {
|
||||
if (uLen != CString::npos) {
|
||||
return strncasecmp(c_str(), s.c_str(), uLen);
|
||||
}
|
||||
return strcasecmp(c_str(), s.c_str());
|
||||
}
|
||||
|
||||
int CString::StrCmp(const CString& s, unsigned long uLen) const {
|
||||
int CString::StrCmp(const CString& s, CString::size_type uLen) const {
|
||||
if (uLen != CString::npos) {
|
||||
return strncmp(c_str(), s.c_str(), uLen);
|
||||
}
|
||||
return strcmp(c_str(), s.c_str());
|
||||
}
|
||||
|
||||
bool CString::Equals(const CString& s, bool bCaseSensitive, unsigned long uLen) const {
|
||||
bool CString::Equals(const CString& s, bool bCaseSensitive, CString::size_type uLen) const {
|
||||
if (bCaseSensitive) {
|
||||
return (StrCmp(s, uLen) == 0);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user