if (!mh)
{
/* No mode handler? Unknown mode character then. */
- user->WriteNumeric(type == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK, modechar, "is an unknown mode character");
+ int numeric = (type == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK);
+ const char* typestr = (type == MODETYPE_CHANNEL ? "channel" : "user");
+ user->WriteNumeric(numeric, modechar, InspIRCd::Format("is not a recognised %s mode.", typestr));
continue;
}
else if ((pos_of_pling == std::string::npos) && (pos_of_at != std::string::npos))
{
/* Has an @ but no !, its a user@host */
- mask = "*!" + mask;
+ mask = "*!" + mask;
}
else if ((pos_of_pling != std::string::npos) && (pos_of_at == std::string::npos))
{
for (unsigned char mode = 'A'; mode <= 'z'; mode++)
{
ModeHandler* mh = modehandlers[mt][mode-65];
- /* One parameter when adding */
if (mh)
{
+ /* One parameter when adding */
if (mh->NeedsParam(true))
{
PrefixMode* pm = mh->IsPrefixMode();