From 396c9ef9f7a96934d3227bb7d1d091315e3d4fa8 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 Aug 2006 14:43:29 +0000 Subject: FindNick, FindChan, ChanModes, UserList, CountInvisible, PurgeEmptyChannels, GetClass, WriteOpers, GetServerDescription -> into classes ServerConfig takes InspIRCd pointer in its constructor git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4832 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_override.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/modules/m_override.cpp') diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index c16a2125f..4f188b0cb 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -22,6 +22,8 @@ /* $ModDesc: Provides support for unreal-style oper-override */ +extern InspIRCd* ServerInstance; + typedef std::map override_t; class ModuleOverride : public Module @@ -93,7 +95,7 @@ class ModuleOverride : public Module { if (((Srv->ChanMode(source,chan) == "%") && (Srv->ChanMode(user,chan) == "@")) || (Srv->ChanMode(source,chan) == "")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")"); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")"); } /* Returning -1 explicitly allows the kick */ return -1; @@ -117,7 +119,7 @@ class ModuleOverride : public Module case AC_DEOP: if (CanOverride(source,"MODEDEOP")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Deopped "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Deopped "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -128,7 +130,7 @@ class ModuleOverride : public Module case AC_OP: if (CanOverride(source,"MODEOP")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Opped "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Opped "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -139,7 +141,7 @@ class ModuleOverride : public Module case AC_VOICE: if (CanOverride(source,"MODEVOICE")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Voiced "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Voiced "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -150,7 +152,7 @@ class ModuleOverride : public Module case AC_DEVOICE: if (CanOverride(source,"MODEDEVOICE")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Devoiced "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Devoiced "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -161,7 +163,7 @@ class ModuleOverride : public Module case AC_HALFOP: if (CanOverride(source,"MODEHALFOP")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Halfopped "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Halfopped "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -172,7 +174,7 @@ class ModuleOverride : public Module case AC_DEHALFOP: if (CanOverride(source,"MODEDEHALFOP")) { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Dehalfopped "+std::string(dest->nick)+" on "+std::string(channel->name)); + ServerInstance->WriteOpers("*** NOTICE: "+std::string(source->nick)+" Override-Dehalfopped "+std::string(dest->nick)+" on "+std::string(channel->name)); return ACR_ALLOW; } else @@ -213,7 +215,7 @@ class ModuleOverride : public Module chan->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :%s invited himself into the channel", cname, user->nick); } } - Srv->SendOpers("*** "+std::string(user->nick)+" used operoverride to bypass +i on "+std::string(cname)); + ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used operoverride to bypass +i on "+std::string(cname)); return -1; } @@ -221,7 +223,7 @@ class ModuleOverride : public Module { if (NoisyOverride) chan->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :%s bypassed the channel key", cname, user->nick); - Srv->SendOpers("*** "+std::string(user->nick)+" used operoverride to bypass +k on "+std::string(cname)); + ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used operoverride to bypass +k on "+std::string(cname)); return -1; } @@ -229,7 +231,7 @@ class ModuleOverride : public Module { if (NoisyOverride) chan->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :%s passed through your channel limit", cname, user->nick); - Srv->SendOpers("*** "+std::string(user->nick)+" used operoverride to bypass +l on "+std::string(cname)); + ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used operoverride to bypass +l on "+std::string(cname)); return -1; } -- cgit v1.2.3