From ef9018da7b49d3ae4071b56858ff11fea9c7aa20 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 10 Feb 2008 16:48:04 +0000 Subject: [PATCH] Add a Rehash command to /msg *status git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@953 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Client.cpp b/Client.cpp index 223e0eeb..0d2a7c65 100644 --- a/Client.cpp +++ b/Client.cpp @@ -686,6 +686,14 @@ void CClient::UserCommand(const CString& sLine) { if (!SendMotd()) { PutStatus("There is no MOTD set."); } + } else if (m_pUser->IsAdmin() && sCommand.CaseCmp("Rehash") == 0) { + CString sRet; + + if (CZNC::Get().RehashConfig(sRet)) { + PutStatus("Rehashing succeeded!"); + } else { + PutStatus("Rehashing failed: " + sRet); + } } else if (m_pUser->IsAdmin() && sCommand.CaseCmp("SaveConfig") == 0) { if (CZNC::Get().WriteConfig()) { PutStatus("Wrote config to [" + CZNC::Get().GetConfigFile() + "]"); @@ -1600,6 +1608,11 @@ void CClient::HelpUser() { } if (m_pUser->IsAdmin()) { + Table.AddRow(); + Table.SetCell("Command", "Rehash"); + Table.SetCell("Arguments", ""); + Table.SetCell("Description", "Reload znc.conf from disk"); + Table.AddRow(); Table.SetCell("Command", "SaveConfig"); Table.SetCell("Arguments", "");