summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 09:59:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 09:59:44 +0000
commitbc0b595b6b9bc6d9fade71117607314cbf54c8c8 (patch)
tree002d0f486d5d8a97cc04b99f0586c6ccceb0a152 /src/modules/m_spanningtree.cpp
parentce0213e10f1c5125a5d1af906136110cdf08c056 (diff)
Added remote kill
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2035 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index d63c11cbf..0c8f03699 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -669,6 +669,22 @@ class TreeSocket : public InspSocket
return true;
}
+ bool RemoteKill(std::string prefix, std::deque<std::string> params)
+ {
+ if (params.size() != 2)
+ return true;
+ std::string nick = params[0];
+ std::string reason = params[1];
+ userrec* u = Srv->FindNick(prefix);
+ userrec* who = Srv->FindNick(nick);
+ if (who)
+ {
+ DoOneToAllButSender(prefix,"KILL",params,u->server)
+ Srv->QuitUser(who,reason);
+ }
+ return true;
+ }
+
bool RemoteServer(std::string prefix, std::deque<std::string> params)
{
if (params.size() < 4)
@@ -914,6 +930,10 @@ class TreeSocket : public InspSocket
{
return this->ForceMode(prefix,params);
}
+ else if (command == "KILL")
+ {
+ return this->RemoteKill(prefix,params);
+ }
else if (command == "SQUIT")
{
if (params.size() == 2)
@@ -1446,6 +1466,14 @@ class ModuleSpanningTree : public Module
}
}
+ virtual void OnRemoteKill(userrec* source, userrec* dest, std::string reason)
+ {
+ std::deque<std::string> params;
+ params.push_back(dest->nick);
+ params.push_back(":"+reason);
+ DoOneToMany(source->nick,"KILL",params);
+ }
+
// note: the protocol does not allow direct umode +o except
// via NICK with 8 params. sending OPERTYPE infers +o modechange
// locally.