- /*
- * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
- * invalid or plain confusing mode changes, code some checking!
- *
- * - I'm not aware what checking I need, so for now... be supreme evil.
- */
- const char* modes[3];
- modes[0] = parameters[0];
- modes[1] = "-v";
- modes[2] = user->nick;
+ Channel* c = ServerInstance->FindChan(parameters[0]);
+ if (c && c->HasUser(user))
+ {
+ std::vector<std::string> modes;
+ modes.push_back(parameters[0]);
+ modes.push_back("-v");
+ modes.push_back(user->nick);
+
+ ServerInstance->SendMode(modes, ServerInstance->FakeClient);
+
+ /* route it -- SendMode doesn't distribute over the whole network */
+ return CMD_SUCCESS;
+ }