aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/treesocket2.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-08-28 21:44:37 +0000
committerGravatar brain2007-08-28 21:44:37 +0000
commit785d309f6eff8a73418f9b7a717b36fc9d4036f2 (patch)
tree45e2817a327751f06c502b0a928715fb3b16b3b2 /src/modules/m_spanningtree/treesocket2.cpp
parentBackport tweak to NAMES reply to show the proper =, * and @ from RFC 2812 (diff)
Backport: Add SVSPART at request of the Anope team - You can tell if the server has SVSPART by the presence of SVSPART=1 in the CAPAB.
No, we will NOT be enforcing this network-wide, its a server-origin command so it wont cause disconnects if it doesnt exist somewhere. git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@7983 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index e6595599b..72573a0fe 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -314,6 +314,29 @@ bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque<std::string>
return true;
}
+bool TreeSocket::ServicePart(const std::string &prefix, std::deque<std::string> &params)
+{
+ if (params.size() < 2)
+ return true;
+
+ if (!this->Instance->IsChannel(params[1].c_str()))
+ return true;
+
+ userrec* u = this->Instance->FindNick(params[0]);
+ chanrec* c = this->Instance->FindChan(params[1]);
+
+ if (u)
+ {
+ /* only part if it's local, otherwise just pass it on! */
+ if (IS_LOCAL(u))
+ if (!c->PartUser(u, "Services forced part"))
+ delete c;
+ Utils->DoOneToAllButSender(prefix,"SVSPART",params,prefix);
+ }
+
+ return true;
+}
+
bool TreeSocket::RemoteRehash(const std::string &prefix, std::deque<std::string> &params)
{
if (params.size() < 1)
@@ -1337,6 +1360,12 @@ bool TreeSocket::ProcessLine(std::string &line)
}
return this->ServiceJoin(prefix,params);
}
+ else if (command == "SVSPART")
+ {
+ if (prefix.empty())
+ prefix = this->GetName();
+ return this->ServicePart(prefix,params);
+ }
else if (command == "SQUIT")
{
if (params.size() == 2)