X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_timedbans.cpp;h=e3a93833686355ad265ea950049e964d6e50b0f4;hb=3fef0ed889eecb40b96a597924254560c81d4a09;hp=29691b338b54161f6e0dcf6d7b9707f9696ab142;hpb=1031f333332cf1b09db4fd632f141143ee637c34;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 29691b338..e3a938336 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -50,14 +50,14 @@ class CommandTban : public Command Channel* channel = ServerInstance->FindChan(parameters[0]); if (!channel) { - user->WriteNumeric(401, "%s %s :No such channel",user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such channel", parameters[0].c_str()); return CMD_FAILURE; } int cm = channel->GetPrefixValue(user); if (cm < HALFOP_VALUE) { - user->WriteNumeric(482, "%s %s :You do not have permission to set bans on this channel", - user->nick.c_str(), channel->name.c_str()); + user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s :You do not have permission to set bans on this channel", + channel->name.c_str()); return CMD_FAILURE; } @@ -75,7 +75,7 @@ class CommandTban : public Command setban.push_back(parameters[0]); setban.push_back("+b"); bool isextban = ((mask.size() > 2) && (mask[1] == ':')); - if (!isextban && !ServerInstance->IsValidMask(mask)) + if (!isextban && !InspIRCd::IsValidMask(mask)) mask.append("!*@*"); setban.push_back(mask); @@ -148,17 +148,6 @@ class ModuleTimedBans : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - ServerInstance->Modes->AddModeWatcher(&banwatcher); - } - - ~ModuleTimedBans() - { - ServerInstance->Modes->DelModeWatcher(&banwatcher); - } - void OnBackgroundTimer(time_t curtime) CXX11_OVERRIDE { timedbans expired;