summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-14 11:53:07 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-14 11:53:07 +0000
commitac71a039c396c323ec5e32e389f0a165a0e21473 (patch)
treeecda6be6a5f8fb8844ae2fe846236649e4c3940b
parent9ab90c52b46cc613d29174fd183330bd9ace1e97 (diff)
Add InspIRCd::AddExtBanChar() to avoid copypasta.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10017 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/inspircd.h4
-rw-r--r--src/helperfuncs.cpp13
2 files changed, 17 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 5e5ebce42..595e65db9 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -875,6 +875,10 @@ class CoreExport InspIRCd : public classbase
*/
void BufferedSocketCull();
+ /** Adds an extban char to the 005 token.
+ */
+ void AddExtBanChar(const char *c);
+
char* GetReadBuffer()
{
return this->ReadBuffer;
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index d46f53ec7..d2c4c7c3e 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -469,3 +469,16 @@ std::string InspIRCd::TimeString(time_t curtime)
return std::string(ctime(&curtime),24);
}
+// You should only pass a single character to this.
+void InspIRCd::AddExtBanChar(const char *c)
+{
+ std::string &tok = Config->data005;
+
+ if (tok.find(" EXTBAN=:") == std::string::npos)
+ {
+ tok.append(" EXTBAN=:");
+ tok.append(c);
+ }
+ else
+ tok.insert(tok.find(" EXTBAN=:") + 9, c);
+}