diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-06 00:29:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-06 00:29:02 +0000 |
commit | eb067467de6777c010dbbca716f27a3f550107ce (patch) | |
tree | a6584f027ebf43267888fa9519e2078cbe115c69 /src/channels.cpp | |
parent | 777827ecd0954aca86de853bb0a5982e5315bd79 (diff) |
Mode-code rewrite. Might act weird, needs proper testing (that is what svn builds are for, after all)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3474 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 3901530a6..f086b9853 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -108,32 +108,12 @@ void chanrec::SetCustomMode(char mode,bool mode_on) } else { - char* mptr = this->custom_modes; - bool shift_down = false; - /* Iterate through the string */ - while (*mptr) + if (charremove(this->custom_modes,mode)) { - /* When we find the mode we intend to remove, set the - * flag to tell the loop to start moving chars down - * one place - */ - if (*mptr == mode) - shift_down = true; - /* If we're moving chars down one place, take the current - * char, and move it down one slot, so: - * ABC\0 becomes BBC\0 then next iteration, BBC\0 becomes - * BC\0. - */ - if (shift_down) - *mptr = *(mptr+1); - *mptr++; - } - - log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes); - - /* Only call this if we found the mode */ - if (shift_down) + log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes); + /* Only call this if we found the mode */ this->SetCustomModeParam(mode,"",false); + } } } |