summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-11-25 12:15:35 +0000
committerPeter Powell <petpow@saberuk.com>2017-11-25 13:38:02 +0000
commit7ece928bab20881d6fe24c4479f4ff9e0a8a7179 (patch)
tree9006cd8dc53b482da1edc62546bedcef5542dad0 /src
parent4ac124cf89b175a0c78025e97205f4ad14fcc39d (diff)
Convert IsNick to std::function.
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp2
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/modules/m_nationalchars.cpp9
3 files changed, 6 insertions, 7 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index ddcff5e55..5d4778b63 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -216,7 +216,7 @@ bool IsChannelHandler::Call(const std::string& chname)
}
/* true for valid nickname, false else */
-bool IsNickHandler::Call(const std::string& n)
+bool InspIRCd::DefaultIsNick(const std::string& n)
{
if (n.empty() || n.length() > ServerInstance->Config->Limits.NickMax)
return false;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 6c45a1a0d..20001dbca 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -228,7 +228,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
*/
GenRandom(&HandleGenRandom),
IsChannel(&HandleIsChannel),
- IsNick(&HandleIsNick),
+ IsNick(&DefaultIsNick),
IsIdent(&HandleIsIdent)
{
ServerInstance = this;
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp
index bb95ecc93..81c2d2959 100644
--- a/src/modules/m_nationalchars.cpp
+++ b/src/modules/m_nationalchars.cpp
@@ -28,10 +28,10 @@
#include "inspircd.h"
#include <fstream>
-class lwbNickHandler : public HandlerBase1<bool, const std::string&>
+class lwbNickHandler
{
public:
- bool Call(const std::string&) CXX11_OVERRIDE;
+ static bool Call(const std::string&);
};
/*,m_reverse_additionalUp[256];*/
@@ -217,10 +217,9 @@ bool lwbNickHandler::Call(const std::string& nick)
class ModuleNationalChars : public Module
{
- lwbNickHandler myhandler;
std::string charset;
unsigned char m_additional[256], m_additionalUp[256], m_lower[256], m_upper[256];
- caller1<bool, const std::string&> rememberer;
+ TR1NS::function<bool(const std::string&)> rememberer;
bool forcequit;
const unsigned char * lowermap_rememberer;
unsigned char prev_map[256];
@@ -259,7 +258,7 @@ class ModuleNationalChars : public Module
memcpy(m_lower, rfc_case_insensitive_map, 256);
national_case_insensitive_map = m_lower;
- ServerInstance->IsNick = &myhandler;
+ ServerInstance->IsNick = &lwbNickHandler::Call;
}
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE