From ec731e80784ec1940faefdd6dc72339c60c2b7ce Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 20 Feb 2006 22:25:56 +0000 Subject: Propogation of remote kicks (testy test) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3266 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_messageflood.cpp | 29 ++++++++++++++++------------- src/modules/m_spanningtree.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 97b51b36f..282a42a3b 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -174,23 +174,26 @@ class ModuleMsgFlood : public Module void ProcessMessages(userrec* user,chanrec* dest,std::string &text) { - floodsettings *f = (floodsettings*)dest->GetExt("flood"); - if (f) + if (IS_LOCAL(user)) { - f->addmessage(user); - if (f->shouldkick(user)) + floodsettings *f = (floodsettings*)dest->GetExt("flood"); + if (f) { - /* Youre outttta here! */ - f->clear(user); - if (f->ban) + f->addmessage(user); + if (f->shouldkick(user)) { - char* parameters[3]; - parameters[0] = dest->name; - parameters[1] = "+b"; - parameters[2] = user->MakeWildHost(); - Srv->SendMode(parameters,3,user); + /* Youre outttta here! */ + f->clear(user); + if (f->ban) + { + char* parameters[3]; + parameters[0] = dest->name; + parameters[1] = "+b"; + parameters[2] = user->MakeWildHost(); + Srv->SendMode(parameters,3,user); + } + Srv->KickUser(NULL, user, dest, "Channel flood triggered (mode +f)"); } - Srv->KickUser(NULL, user, dest, "Channel flood triggered (mode +f)"); } } } diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 9397b6b59..33e5e5031 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2345,6 +2345,24 @@ class TreeSocket : public InspSocket { return this->Time(prefix,params); } + else if (command == "KICK") + { + std::string sourceserv = this->myhost; + if (params.size() == 3) + { + userrec* user = Srv->FindNick(params[1]); + chanrec* chan = Srv->FindChannel(params[0]); + if (user && chan) + { + server_kick_channel(user,chan,(char*)params[2].c_str(),false); + } + } + if (this->InboundServerName != "") + { + sourceserv = this->InboundServerName; + } + return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); + } else if (command == "SVSJOIN") { if (prefix == "") @@ -2757,7 +2775,7 @@ class ModuleSpanningTree : public Module } for (unsigned int q = 0; q < Current->ChildCount(); q++) { - if ((HideULines) && (Srv->IsUlined(Current->GetChild(q)))) + if ((HideULines) && (Srv->IsUlined(Current->GetChild(q)->GetName()))) { if (*user->oper) { @@ -3466,6 +3484,14 @@ class ModuleSpanningTree : public Module params.push_back(":"+reason); DoOneToMany(source->nick,"KICK",params); } + else if (!source) + { + std::deque params; + params.push_back(chan->name); + params.push_back(user->nick); + params.push_back(":"+reason); + DoOneToMany(Srv->GetServerName(),"KICK",params); + } } virtual void OnRemoteKill(userrec* source, userrec* dest, std::string reason) -- cgit v1.2.3