diff options
Diffstat (limited to 'src/modules/m_nationalchars.cpp')
-rw-r--r-- | src/modules/m_nationalchars.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp index b43b6e2b6..59277bb9e 100644 --- a/src/modules/m_nationalchars.cpp +++ b/src/modules/m_nationalchars.cpp @@ -31,12 +31,12 @@ /* $ModDesc: Provides an ability to have non-RFC1459 nicks & support for national CASEMAPPING */ -class lwbNickHandler : public HandlerBase2<bool, const char*, size_t> +class lwbNickHandler : public HandlerBase2<bool, const std::string&, size_t> { public: lwbNickHandler() { } virtual ~lwbNickHandler() { } - virtual bool Call(const char*, size_t); + virtual bool Call(const std::string&, size_t); }; /*,m_reverse_additionalUp[256];*/ @@ -71,11 +71,12 @@ char utf8size(unsigned char * mb) /* Conditions added */ -bool lwbNickHandler::Call(const char* n, size_t max) +bool lwbNickHandler::Call(const std::string& nick, size_t max) { - if (!n || !*n) + if (nick.empty()) return false; + const char* n = nick.c_str(); unsigned int p = 0; for (const char* i = n; *i; i++, p++) { @@ -225,7 +226,7 @@ class ModuleNationalChars : public Module lwbNickHandler myhandler; std::string charset, casemapping; unsigned char m_additional[256], m_additionalUp[256], m_lower[256], m_upper[256]; - caller2<bool, const char*, size_t> rememberer; + caller2<bool, const std::string&, size_t> rememberer; bool forcequit; const unsigned char * lowermap_rememberer; @@ -276,7 +277,7 @@ class ModuleNationalChars : public Module { /* Fix by Brain: Dont quit UID users */ User* n = *iter; - if (!isdigit(n->nick[0]) && !ServerInstance->IsNick(n->nick.c_str(), ServerInstance->Config->Limits.NickMax)) + if (!isdigit(n->nick[0]) && !ServerInstance->IsNick(n->nick, ServerInstance->Config->Limits.NickMax)) ServerInstance->Users->QuitUser(n, message); } } |