diff options
-rw-r--r-- | include/inspircd.h | 4 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 13 |
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); +} |