- ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse());
-
- std::deque<std::string> n;
- irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse());
- std::string one;
- while (spaced.GetToken(one))
- n.push_back(one);
-
- std::string channel = n[0];
- n.pop_front();
- ServerInstance->PI->SendMode(channel, n);
-
- /* XXX: Yes, this is right. We dont want to propagate the
- * actual SAMODE command, just the MODE command generated
- * by the Protocol Interface
- */
- return CMD_LOCALONLY;
+ User* target = ServerInstance->FindNickOnly(parameters[0]);
+ if ((!target) || (target->registered != REG_ALL))
+ {
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+ return CMD_FAILURE;
+ }