X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_denychans.cpp;h=184134025730d7d404faa09d0f582b15ac7dcda4;hb=ad47ea662698e72ff8f79b03512b1e7fe81bdf53;hp=237447ac7dfd915a4a2aca69e14f48bcb0e2f0de;hpb=d24619c012b34d5a3d4cfb93e7bea3ff3d5721e7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index 237447ac7..184134025 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -32,7 +32,7 @@ class ModuleDenyChannels : public Module { } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { /* check for redirect validity and loops/chains */ ConfigTagList tags = ServerInstance->Config->ConfTags("badchan"); @@ -46,8 +46,8 @@ class ModuleDenyChannels : public Module if (!ServerInstance->IsChannel(redirect)) { - if (user) - user->WriteNotice("Invalid badchan redirect '" + redirect + "'"); + if (status.srcuser) + status.srcuser->WriteNotice("Invalid badchan redirect '" + redirect + "'"); throw ModuleException("Invalid badchan redirect, not a channel"); } @@ -66,8 +66,8 @@ class ModuleDenyChannels : public Module if (!goodchan) { /* is a badchan */ - if (user) - user->WriteNotice("Badchan " + name + " redirects to badchan " + redirect); + if (status.srcuser) + status.srcuser->WriteNotice("Badchan " + name + " redirects to badchan " + redirect); throw ModuleException("Badchan redirect loop"); } } @@ -113,13 +113,13 @@ class ModuleDenyChannels : public Module Channel *newchan = ServerInstance->FindChan(redirect); if ((!newchan) || (!newchan->IsModeSet(redirectmode))) { - user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str()); + user->WriteNumeric(926, "%s :Channel %s is forbidden, redirecting to %s: %s", cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str()); Channel::JoinUser(user, redirect); return MOD_RES_DENY; } } - user->WriteNumeric(926, "%s %s :Channel %s is forbidden: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),reason.c_str()); + user->WriteNumeric(926, "%s :Channel %s is forbidden: %s", cname.c_str(),cname.c_str(),reason.c_str()); return MOD_RES_DENY; } }