From ac71a039c396c323ec5e32e389f0a165a0e21473 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 14 Jul 2008 11:53:07 +0000 Subject: Add InspIRCd::AddExtBanChar() to avoid copypasta. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10017 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/helperfuncs.cpp') 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); +} -- cgit v1.2.3