From c5c4ed7ed13b4322fd647590e615ef0aeb5033e5 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 14 Jun 2007 17:39:38 +0000 Subject: This should fix bug #317, we shouldnt be using send_mode for user modes, we should use send_mode_explicit spanningtree event git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7306 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_opermodes.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 25c1b4fe6..a8aa615cf 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -80,28 +80,24 @@ class ModuleModesOnOper : public Module tokens.push_back(buf); int size = tokens.size() + 1; - char** modes = new char*[size]; + const char** modes = new const char*[size]; modes[0] = user->nick; - modes[1] = (char*)tokens[0].c_str(); - if (tokens.size() > 1) + // process mode params + int i = 1; + for (unsigned int k = 1; k < tokens.size(); k++) { - // process mode params - int i = 2; - for (unsigned int k = 1; k < tokens.size(); k++) - { - modes[i] = (char*)tokens[k].c_str(); - i++; - } + modes[i] = tokens[k].c_str(); + i++; } + std::deque n; - Event rmode((char *)&n, NULL, "send_mode"); + Event rmode((char *)&n, NULL, "send_mode_explicit"); for (unsigned int j = 0; j < tokens.size(); j++) - { n.push_back(modes[j]); - } + rmode.Send(ServerInstance); - ServerInstance->SendMode((const char**)modes, size, user); + ServerInstance->SendMode(modes, size, user); delete [] modes; } break; -- cgit v1.2.3