/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2012 Shawn Smith <shawn@inspircd.org>
+ * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
+ * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw>
+ * Copyright (C) 2016-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012-2016, 2018 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2012 Shawn Smith <ShawnSmith0828@gmail.com>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- * Copyright (C) 2007, 2009 Dennis Friis <peavey@inspircd.org>
- * Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
+ * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
* Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
- * Copyright (C) 2004-2008 Craig Edwards <craigedwards@brainbox.cc>
- * Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
+ * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
+ * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ * Copyright (C) 2006-2008, 2010 Craig Edwards <brain@inspircd.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel)
{
- const std::string message = InspIRCd::Format("You must specify a parameter for the %s mode", name.c_str());
+ std::string message = InspIRCd::Format("You must specify a parameter for the %s mode.", name.c_str());
+ if (!syntax.empty())
+ message.append(InspIRCd::Format(" Syntax: %s.", syntax.c_str()));
+
if (channel)
user->WriteNumeric(Numerics::InvalidModeParameter(channel, this, "*", message));
else
, selfremove(true)
{
list = true;
+ syntax = "<nick>";
}
ModResult PrefixMode::AccessCheck(User* src, Channel*, std::string& value, bool adding)
const bool needs_param = mh->NeedsParam(adding);
std::string& parameter = mcitem.param;
- // crop mode parameter size to 250 characters
- if (parameter.length() > 250 && adding)
- parameter.erase(250);
+ // crop mode parameter size to MODE_PARAM_MAX characters
+ if (parameter.length() > MODE_PARAM_MAX && adding)
+ parameter.erase(MODE_PARAM_MAX);
ModResult MOD_RESULT;
FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, mh, parameter, adding));