* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
if (parameter.rfind(' ') != std::string::npos)
return MODEACTION_DENY;
- /* must first unset if we are changing the key, otherwise it will be ignored */
- if (exists && adding)
- channel->SetMode('k', false);
-
- /* must run setmode always, to process the change */
- channel->SetMode('k', adding);
-
if (adding)
{
std::string ckey;
ckey.assign(parameter, 0, 32);
parameter = ckey;
- /* running this does not run setmode, despite the third parameter */
- channel->SetModeParam('k', parameter.c_str(), true);
+ channel->SetModeParam('k', parameter);
+ }
+ else
+ {
+ channel->SetModeParam('k', "");
}
return MODEACTION_ALLOW;
}