From 55c1232e5e32e074456a845b61024c99f8db991f Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 28 Aug 2008 10:47:01 +0000 Subject: [PATCH] Add a 'ShowMOTD' command to *status and reorder 'HELP' output ShowMOTD is now close to the other MOTD commands which only admins can access. The old 'MOTD' is still available, but the help doesn't mention it anymore in favor of 'MOTD'. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1175 726aef4b-f618-498e-8847-2d620e286838 --- ClientCommand.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ClientCommand.cpp b/ClientCommand.cpp index 113e974b..f4d1a5d2 100644 --- a/ClientCommand.cpp +++ b/ClientCommand.cpp @@ -111,7 +111,7 @@ void CClient::UserCommand(const CString& sLine) { } } else if (sCommand.CaseCmp("VERSION") == 0) { PutStatus(CZNC::GetTag()); - } else if (sCommand.CaseCmp("MOTD") == 0) { + } else if (sCommand.CaseCmp("MOTD") == 0 || sCommand.CaseCmp("ShowMOTD") == 0) { if (!SendMotd()) { PutStatus("There is no MOTD set."); } @@ -984,11 +984,6 @@ void CClient::HelpUser() { Table.SetCell("Arguments", ""); Table.SetCell("Description", "Prints which version of znc this is"); - Table.AddRow(); - Table.SetCell("Command", "MOTD"); - Table.SetCell("Arguments", ""); - Table.SetCell("Description", "Show the message of the day"); - Table.AddRow(); Table.SetCell("Command", "ListDCCs"); Table.SetCell("Arguments", ""); @@ -1125,7 +1120,27 @@ void CClient::HelpUser() { Table.SetCell("Description", "Reload a module"); } + Table.AddRow(); + Table.SetCell("Command", "ShowMOTD"); + Table.SetCell("Arguments", ""); + Table.SetCell("Description", "Show the message of the day"); + if (m_pUser->IsAdmin()) { + Table.AddRow(); + Table.SetCell("Command", "SetMOTD"); + Table.SetCell("Arguments", ""); + Table.SetCell("Description", "Set the message of the day"); + + Table.AddRow(); + Table.SetCell("Command", "AddMOTD"); + Table.SetCell("Arguments", ""); + Table.SetCell("Description", "Append to MOTD"); + + Table.AddRow(); + Table.SetCell("Command", "ClearMOTD"); + Table.SetCell("Arguments", ""); + Table.SetCell("Description", "Clear the MOTD"); + Table.AddRow(); Table.SetCell("Command", "Rehash"); Table.SetCell("Arguments", ""); @@ -1156,21 +1171,6 @@ void CClient::HelpUser() { Table.SetCell("Arguments", ""); Table.SetCell("Description", "Show how long ZNC is already running"); - Table.AddRow(); - Table.SetCell("Command", "SetMOTD"); - Table.SetCell("Arguments", ""); - Table.SetCell("Description", "Set the message of the day"); - - Table.AddRow(); - Table.SetCell("Command", "AddMOTD"); - Table.SetCell("Arguments", ""); - Table.SetCell("Description", "Append to MOTD"); - - Table.AddRow(); - Table.SetCell("Command", "ClearMOTD"); - Table.SetCell("Arguments", ""); - Table.SetCell("Description", "Clear the MOTD"); - Table.AddRow(); Table.SetCell("Command", "Broadcast"); Table.SetCell("Arguments", "[message]");