targetuser = ServerInstance->FindNick(target);
}
- if ((!targetchannel) && ((!targetuser) || (IS_SERVER(targetuser))))
+ if ((!targetchannel) && (!targetuser))
{
- user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", target.c_str());
+ user->WriteNumeric(Numerics::NoSuchNick(target));
return CMD_FAILURE;
}
if (parameters.size() == 1)
if ((targetuser) && (user != targetuser))
{
// Local users may only change the modes of other users if a module explicitly allows it
- user->WriteNumeric(ERR_USERSDONTMATCH, ":Can't change mode for other users");
+ user->WriteNumeric(ERR_USERSDONTMATCH, "Can't change mode for other users");
return CMD_FAILURE;
}
if (targetchannel)
{
// Display channel's current mode string
- user->WriteNumeric(RPL_CHANNELMODEIS, "%s +%s", targetchannel->name.c_str(), targetchannel->ChanModes(targetchannel->HasUser(user)));
- user->WriteNumeric(RPL_CHANNELCREATED, "%s %lu", targetchannel->name.c_str(), (unsigned long)targetchannel->age);
+ user->WriteNumeric(RPL_CHANNELMODEIS, targetchannel->name, (std::string("+") + targetchannel->ChanModes(targetchannel->HasUser(user))));
+ user->WriteNumeric(RPL_CHANNELCREATED, targetchannel->name, (unsigned long)targetchannel->age);
}
else
{
}
else
{
- user->WriteNumeric(ERR_USERSDONTMATCH, ":Can't view modes for other users");
+ user->WriteNumeric(ERR_USERSDONTMATCH, "Can't view modes for other users");
}
}
}