make /#setting command show the current value if no value is in the command

This commit is contained in:
darkrose 2013-12-27 13:12:00 +10:00
parent 415cb4ffc2
commit 3db88317cf
1 changed files with 8 additions and 2 deletions

View File

@ -172,12 +172,18 @@ void cmd_shutdown(std::wostringstream &os,
void cmd_setting(std::wostringstream &os, void cmd_setting(std::wostringstream &os,
ServerCommandContext *ctx) ServerCommandContext *ctx)
{ {
if((ctx->privs & PRIV_SERVER) ==0) if ((ctx->privs & PRIV_SERVER) ==0) {
{
os<<L"-!- You don't have permission to do that"; os<<L"-!- You don't have permission to do that";
return; return;
} }
/* no value is set, so instead show the current value */
if (ctx->parms.size() == 2) {
os << L"-!- '" << ctx->parms[1] << L"' has value '"
<< narrow_to_wide(g_settings->get(wide_to_narrow(ctx->parms[1]))) << L"'";
return;
}
/*std::string confline = wide_to_narrow( /*std::string confline = wide_to_narrow(
ctx->parms[1] + L" = " + ctx->params[2]);*/ ctx->parms[1] + L" = " + ctx->params[2]);*/