diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-14 11:53:07 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-14 11:53:07 +0000 |
commit | ac71a039c396c323ec5e32e389f0a165a0e21473 (patch) | |
tree | ecda6be6a5f8fb8844ae2fe846236649e4c3940b /src | |
parent | 9ab90c52b46cc613d29174fd183330bd9ace1e97 (diff) |
Add InspIRCd::AddExtBanChar() to avoid copypasta.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10017 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/helperfuncs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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); +} |