summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-01 16:15:19 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-01 16:15:19 +0200
commit6a080dfd911e9463d35aad226384aa2a94f38057 (patch)
treecb7507fd3e2876f6d06a7a94dc7680847f00cc7a
parentde9cf90b6b9c0a65ec21030c3906306b5c17bde8 (diff)
Convert IsSID() to a static member function, modules shouldn't override it
-rw-r--r--include/inspircd.h4
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/helperfuncs.cpp2
-rw-r--r--src/inspircd.cpp1
-rw-r--r--src/modules/m_spanningtree/server.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
6 files changed, 5 insertions, 8 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index a7469c52d..456a78d40 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -267,7 +267,6 @@ DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
DEFINE_HANDLER2(GenRandomHandler, void, char*, size_t);
DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
DEFINE_HANDLER2(IsChannelHandler, bool, const char*, size_t);
-DEFINE_HANDLER1(IsSIDHandler, bool, const std::string&);
DEFINE_HANDLER1(RehashHandler, void, const std::string&);
DEFINE_HANDLER3(OnCheckExemptionHandler, ModResult, User*, Channel*, const std::string&);
@@ -337,7 +336,6 @@ class CoreExport InspIRCd
IsIdentHandler HandleIsIdent;
OnCheckExemptionHandler HandleOnCheckExemption;
IsChannelHandler HandleIsChannel;
- IsSIDHandler HandleIsSID;
RehashHandler HandleRehash;
GenRandomHandler HandleGenRandom;
@@ -573,7 +571,7 @@ class CoreExport InspIRCd
/** Return true if str looks like a server ID
* @param string to check against
*/
- caller1<bool, const std::string&> IsSID;
+ static bool IsSID(const std::string& sid);
/** Rehash the local server
*/
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 1f863ba62..df78fcab8 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -483,7 +483,7 @@ void ServerConfig::Fill()
ServerName = ConfValue("server")->getString("name");
sid = ConfValue("server")->getString("id");
ValidHost(ServerName, "<server:name>");
- if (!sid.empty() && !ServerInstance->IsSID(sid))
+ if (!InspIRCd::IsSID(sid))
throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter.");
}
else
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 5a8f55f11..7ee78c46e 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -367,7 +367,7 @@ bool IsIdentHandler::Call(const char* n)
return true;
}
-bool IsSIDHandler::Call(const std::string &str)
+bool InspIRCd::IsSID(const std::string &str)
{
/* Returns true if the string given is exactly 3 characters long,
* starts with a digit, and the other two characters are A-Z or digits
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 164b7c1e7..68d1917c4 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -321,7 +321,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
OperQuit("OperQuit", NULL),
GenRandom(&HandleGenRandom),
IsChannel(&HandleIsChannel),
- IsSID(&HandleIsSID),
Rehash(&HandleRehash),
IsNick(&HandleIsNick),
IsIdent(&HandleIsIdent),
diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp
index 33c7f47b3..e6cec5cb4 100644
--- a/src/modules/m_spanningtree/server.cpp
+++ b/src/modules/m_spanningtree/server.cpp
@@ -55,7 +55,7 @@ bool TreeSocket::RemoteServer(const std::string &prefix, parameterlist &params)
this->SendError("Protocol error - Introduced remote server from unknown server "+prefix);
return false;
}
- if (!ServerInstance->IsSID(sid))
+ if (!InspIRCd::IsSID(sid))
{
this->SendError("Invalid format server ID: "+sid+"!");
return false;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index cc1c400db..13d188432 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -61,7 +61,7 @@ ModResult ModuleSpanningTree::OnAcceptConnection(int newsock, ListenSocket* from
*/
TreeServer* SpanningTreeUtilities::FindServer(const std::string &ServerName)
{
- if (ServerInstance->IsSID(ServerName))
+ if (InspIRCd::IsSID(ServerName))
return this->FindServerID(ServerName);
server_hash::iterator iter = serverlist.find(ServerName.c_str());