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
This commit is contained in:
psychon
2008-08-28 10:47:01 +00:00
parent 3325f450c7
commit 55c1232e5e

View File

@@ -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", "<Message>");
Table.SetCell("Description", "Set the message of the day");
Table.AddRow();
Table.SetCell("Command", "AddMOTD");
Table.SetCell("Arguments", "<Message>");
Table.SetCell("Description", "Append <Message> 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", "<Message>");
Table.SetCell("Description", "Set the message of the day");
Table.AddRow();
Table.SetCell("Command", "AddMOTD");
Table.SetCell("Arguments", "<Message>");
Table.SetCell("Description", "Append <Message> 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]");