]> jfr.im git - irc/rizon/znc.git/commitdiff
Add a 'ShowMOTD' command to *status and reorder 'HELP' output
authorpsychon <redacted>
Thu, 28 Aug 2008 10:47:01 +0000 (10:47 +0000)
committerpsychon <redacted>
Thu, 28 Aug 2008 10:47:01 +0000 (10:47 +0000)
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

index 113e974b475eee01aa0367a2c11c905168f051c4..f4d1a5d28f09eadf1d69e7e5a80a096adf8f71ea 100644 (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]");