X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=637eb7ba5c805d30ef01c60d6e0afdc9c33bebc7;hb=c2a3ebea46f3527e0680f1258725f95ff13f0880;hp=9973df411094cdfb6aba296328dc11d2b0dbd411;hpb=2aae57ca07b3de40feb72a21b2f2dea521665d80;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index 9973df411..637eb7ba5 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -291,8 +291,8 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool ModeHandler* neededmh = NULL; for(char c='A'; c <= 'z'; c++) { - ModeHandler *privmh = FindMode(modechar, type); - if (privmh->GetPrefixRank() >= neededrank) + ModeHandler *privmh = FindMode(c, MODETYPE_CHANNEL); + if (privmh && privmh->GetPrefixRank() >= neededrank) { // this mode is sufficient to allow this action if (!neededmh || privmh->GetPrefixRank() < neededmh->GetPrefixRank()) @@ -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;