summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/treesocket.h4
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp29
3 files changed, 34 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index d7b59447c..a798976d2 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -299,6 +299,10 @@ class TreeSocket : public InspSocket
*/
bool ServiceJoin(const std::string &prefix, std::deque<std::string> &params);
+ /** SVSPART
+ */
+ bool ServicePart(const std::string &prefix, std::deque<std::string> &params);
+
/** REHASH
*/
bool RemoteRehash(const std::string &prefix, std::deque<std::string> &params);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index a7cdb777a..fcfb21f68 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -371,7 +371,7 @@ void TreeSocket::SendCapabilities()
extra = " CHALLENGE=" + this->GetOurChallenge();
}
- this->WriteLine("CAPAB CAPABILITIES :NICKMAX="+ConvToStr(NICKMAX)+" HALFOP="+ConvToStr(this->Instance->Config->AllowHalfop)+" CHANMAX="+ConvToStr(CHANMAX)+" MAXMODES="+ConvToStr(MAXMODES)+" IDENTMAX="+ConvToStr(IDENTMAX)+" MAXQUIT="+ConvToStr(MAXQUIT)+" MAXTOPIC="+ConvToStr(MAXTOPIC)+" MAXKICK="+ConvToStr(MAXKICK)+" MAXGECOS="+ConvToStr(MAXGECOS)+" MAXAWAY="+ConvToStr(MAXAWAY)+" IP6NATIVE="+ConvToStr(ip6)+" IP6SUPPORT="+ConvToStr(ip6support)+" PROTOCOL="+ConvToStr(ProtocolVersion)+extra+" PREFIX="+Instance->Modes->BuildPrefixes()+" CHANMODES="+Instance->Modes->ChanModes());
+ this->WriteLine("CAPAB CAPABILITIES :NICKMAX="+ConvToStr(NICKMAX)+" HALFOP="+ConvToStr(this->Instance->Config->AllowHalfop)+" CHANMAX="+ConvToStr(CHANMAX)+" MAXMODES="+ConvToStr(MAXMODES)+" IDENTMAX="+ConvToStr(IDENTMAX)+" MAXQUIT="+ConvToStr(MAXQUIT)+" MAXTOPIC="+ConvToStr(MAXTOPIC)+" MAXKICK="+ConvToStr(MAXKICK)+" MAXGECOS="+ConvToStr(MAXGECOS)+" MAXAWAY="+ConvToStr(MAXAWAY)+" IP6NATIVE="+ConvToStr(ip6)+" IP6SUPPORT="+ConvToStr(ip6support)+" PROTOCOL="+ConvToStr(ProtocolVersion)+extra+" PREFIX="+Instance->Modes->BuildPrefixes()+" CHANMODES="+Instance->Modes->ChanModes()+" SVSPART=1");
this->WriteLine("CAPAB END");
}
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index fa9c97a45..249507799 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -339,6 +339,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)
@@ -1408,6 +1431,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)