summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-24 10:44:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-24 10:44:45 +0000
commite2f7117e87b84b4e609189643e393cc840db0734 (patch)
tree3b3f11f09b9fcb223a0818818861902d71f00cd9 /src/modules/m_spanningtree.cpp
parente71fa7cc6bdd4f632b96517a7204d926e8805974 (diff)
Add new server to server command:
:server.name REMSTATUS #channel NOTE: Protocol version bumped to 1101 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5314 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 8b410900a..05f5a4ab9 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -37,7 +37,7 @@ using namespace std;
/** If you make a change which breaks the protocol, increment this.
* If you completely change the protocol, completely change the number.
*/
-const long ProtocolVersion = 1100;
+const long ProtocolVersion = 1101;
/*
* The server list in InspIRCd is maintained as two structures
@@ -2620,6 +2620,52 @@ class TreeSocket : public InspSocket
}
}
+ bool RemoveStatus(std::string prefix, std::deque<std::string> &params)
+ {
+ if (params.size() < 1)
+ return true;
+
+ chanrec* c = Instance->FindChan(params[0]);
+
+ if (c)
+ {
+ CUList *ulist = c->GetUsers();
+ for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
+ {
+ std::string modesequence = Instance->Modes->ModeString(i->second, c);
+ if (modesequence.length())
+ {
+ modesequence = "-" + modesequence;
+
+ std::deque<std::string> items;
+ const char* y[127];
+ unsigned int z = 0;
+ std::string x = "*";
+ irc::spacesepstream sep(modesequence);
+
+ while ((x = sep.GetToken()) != "")
+ {
+ if (!z)
+ {
+ y[z++] = c->name;
+ items.push_back(c->name);
+ items.push_back(ConvToStr(c->age));
+ }
+ items.push_back(x);
+ y[z++] = (items.end() - 1)->c_str();
+ }
+
+ DoOneToMany(Instance->Config->ServerName, "FMODE", items);
+ userrec* n = new userrec(Instance);
+ n->SetFd(FD_MAGIC_NUMBER);
+ Instance->SendMode(y,z,n);
+ delete n;
+ }
+ }
+ }
+ return true;
+ }
+
bool RemoteServer(std::string prefix, std::deque<std::string> &params)
{
if (params.size() < 4)
@@ -3015,6 +3061,10 @@ class TreeSocket : public InspSocket
{
return this->MetaData(prefix,params);
}
+ else if (command == "REMSTATUS")
+ {
+ return this->RemoveStatus(prefix,params);
+ }
else if (command == "PING")
{
/*