summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-06 16:35:07 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-06 16:35:07 +0000
commitc5d24dd9bd4ce165e5ebdbcd8a58a63d9d4ac999 (patch)
tree6385fd94cdda54adcde85aeffab889a16b60b4e2 /src/mode.cpp
parent7bff99d3dca97374f8d029b393bcd113f6dfa89a (diff)
Fail adding of new mode when its prefix is already in use
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12386 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 7aeaae1dc..637eb7ba5 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -644,6 +644,9 @@ bool ModeParser::AddMode(ModeHandler* mh)
if ((mh->GetPrefix() == ',') || (mh->GetPrefix() == ':') || (mh->GetPrefix() == '#'))
return false;
+ if (mh->GetPrefix() && FindPrefix(mh->GetPrefix()))
+ return false;
+
mh->GetModeType() == MODETYPE_USER ? mask = MASK_USER : mask = MASK_CHANNEL;
pos = (mh->GetModeChar()-65) | mask;