diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-10 22:06:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-10 22:06:53 +0000 |
commit | 343b92d82b6c9ce0415c26390ad2921c6d54ff67 (patch) | |
tree | e8408cb0279428e775102074ed1d085daf22dcff /src/modules | |
parent | e5d96bc591355df539415809123e4eb2ebe45058 (diff) |
This now makes RemoveStatus remove *everything* as pointed out by jilles. This will prevent simplemodes desyncs.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6651 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 464f4e9dc..d287d4724 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -691,8 +691,7 @@ bool TreeSocket::LocalPing(const std::string &prefix, std::deque<std::string> &p } } -/** TODO: This really should remove *everything* not just status modes (thanks jilles) - * - This means listmodes, simplemodes, etc too. +/** TODO: This creates a total mess of output and needs to really use irc::modestacker. */ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string> ¶ms) { @@ -701,41 +700,11 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string> chanrec* c = Instance->FindChan(params[0]); if (c) { - irc::modestacker modestack(false); - CUList *ulist = c->GetUsers(); - const char* y[127]; - std::deque<std::string> stackresult; - std::string x; - for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) + for (char modeletter = 'A'; modeletter <= 'z'; modeletter++) { - std::string modesequence = Instance->Modes->ModeString(i->second, c); - if (modesequence.length()) - { - irc::spacesepstream sep(modesequence); - std::string modeletters = sep.GetToken(); - while (!modeletters.empty()) - { - char mletter = *(modeletters.begin()); - modestack.Push(mletter,sep.GetToken()); - modeletters.erase(modeletters.begin()); - } - } - } - - while (modestack.GetStackedLine(stackresult)) - { - stackresult.push_front(ConvToStr(c->age)); - stackresult.push_front(c->name); - Utils->DoOneToMany(Instance->Config->ServerName, "FMODE", stackresult); - stackresult.erase(stackresult.begin() + 1); - for (size_t z = 0; z < stackresult.size(); z++) - { - y[z] = stackresult[z].c_str(); - } - userrec* n = new userrec(Instance); - n->SetFd(FD_MAGIC_NUMBER); - Instance->SendMode(y, stackresult.size(), n); - delete n; + ModeHandler* mh = Instance->Modes->FindMode(modeletter, MODETYPE_CHANNEL); + if (mh) + mh->RemoveMode(c); } } return true; |