X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_kicknorejoin.cpp;h=7d0e7fb8930ae16767a904841204412c79620cf2;hb=de4e4860091fe5a9a530acdb25f9a17e22323acf;hp=b8a7766675e8e191ea0cb45331ba495058f695d9;hpb=8f5efbc7aa33b792e02d01e3288f553e6e98ccaa;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index b8a776667..7d0e7fb89 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -25,6 +25,13 @@ #include "inspircd.h" +enum +{ + // From RFC 2182. + ERR_UNAVAILRESOURCE = 437 +}; + + class KickRejoinData { struct KickedUser @@ -91,11 +98,14 @@ class KickRejoin : public ParamMode > { } - ModeAction OnSet(User* source, Channel* channel, std::string& parameter) + ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE { int v = ConvToInt(parameter); if (v <= 0) + { + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; + } if ((IS_LOCAL(source) && ((unsigned int)v > max))) v = max; @@ -132,7 +142,7 @@ public: const KickRejoinData* data = kr.ext.get(chan); if ((data) && (!data->canjoin(user))) { - user->WriteNumeric(ERR_DELAYREJOIN, "%s :You must wait %u seconds after being kicked to rejoin (+J)", chan->name.c_str(), data->delay); + user->WriteNumeric(ERR_UNAVAILRESOURCE, chan, InspIRCd::Format("You must wait %u seconds after being kicked to rejoin (+J)", data->delay)); return MOD_RES_DENY; } }