diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 56d1f398f..34070e5a1 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -560,6 +560,20 @@ bool ModeParser::AddMode(ModeHandler* mh, unsigned const char modeletter) return true; } +ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt) +{ + unsigned char mask = 0; + unsigned char pos = 0; + + if ((modeletter < 'A') || (modeletter > 'z')) + return NULL; + + mt == MODETYPE_USER ? mask = MASK_USER : mask = MASK_CHANNEL; + pos = (modeletter-65) | mask; + + return modehandlers[pos]; +} + bool ModeParser::AddModeWatcher(ModeWatcher* mw) { unsigned char mask = 0; |