From 0f25d9c48f75b270da3ec7c86b21f17877513f21 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 May 2015 01:21:39 +0300 Subject: Add chat command to show configuration variable in chat. New chat command: /confget varname Alias: /getconf varname --- src/actions/commands.cpp | 12 ++++++++++++ src/actions/commands.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index e5ad161e3..d56995745 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -935,4 +935,16 @@ impHandler(serverConfSet) return false; } +impHandler(confGet) +{ + const std::string args = event.args; + if (args.empty()) + return false; + + const std::string str = strprintf(_("Config value: %s"), + config.getStringValue(args).c_str()); + outStringNormal(event.tab, str, str); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index d97d73663..9a6d1df3c 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -87,6 +87,7 @@ namespace Actions decHandler(leaveChatRoom); decHandler(confSet); decHandler(serverConfSet); + decHandler(confGet); } // namespace Actions #undef decHandler -- cgit v1.2.3-70-g09d2