]> jfr.im git - irc/znc/znc.git/commitdiff
admindebug: language/style fixes
authorAlexey Sokolov <redacted>
Thu, 26 Jul 2018 00:08:35 +0000 (01:08 +0100)
committerAlexey Sokolov <redacted>
Thu, 26 Jul 2018 00:10:52 +0000 (01:10 +0100)
modules/admindebug.cpp

index 2f68f5e22c9d08b848b225b457e3d71f48d38e13..61327295f1580199877132870ff667cc573c76cf 100644 (file)
@@ -36,7 +36,7 @@ class CAdminDebugMod : public CModule {
     }\r
 \r
     void CommandEnable(const CString& sCommand) {\r
-        if (GetUser()->IsAdmin() == false) {\r
+        if (!GetUser()->IsAdmin()) {\r
             PutModule(t_s("Access denied!"));\r
             return;\r
         }\r
@@ -45,7 +45,7 @@ class CAdminDebugMod : public CModule {
     }\r
 \r
     void CommandDisable(const CString& sCommand) {\r
-        if (GetUser()->IsAdmin() == false) {\r
+        if (!GetUser()->IsAdmin()) {\r
             PutModule(t_s("Access denied!"));\r
             return;\r
         }\r
@@ -53,7 +53,7 @@ class CAdminDebugMod : public CModule {
         ToggleDebug(false, m_sEnabledBy);\r
     }\r
 \r
-    bool ToggleDebug(bool bEnable, CString sEnabledBy) {\r
+    bool ToggleDebug(bool bEnable, const CString& sEnabledBy) {\r
         if (!CDebug::StdoutIsTTY()) {\r
             PutModule(t_s("Failure. We need to be running with a TTY. (is ZNC running with --foreground?)"));\r
             return false;\r
@@ -71,15 +71,14 @@ class CAdminDebugMod : public CModule {
         }\r
 \r
         CDebug::SetDebug(bEnable);\r
-        CString sEnabled = CString(bEnable ? "on" : "off");\r
-        CZNC::Get().Broadcast(CString(\r
-            "An administrator has just turned Debug Mode \02" + sEnabled + "\02. It was enabled by \02" + sEnabledBy + "\02."\r
-        ));\r
+        CString sEnabled = bEnable ? "on" : "off";\r
+        CZNC::Get().Broadcast(\r
+            "An administrator has just turned Debug Mode \02" + sEnabled +\r
+            "\02. It was enabled by \02" + sEnabledBy + "\02.");\r
         if (bEnable) {\r
             CZNC::Get().Broadcast(\r
-                CString("Messages, credentials, and other sensitive data may"\r
-                " become exposed to the host during this period.")\r
-            );\r
+                "Messages, credentials, and other sensitive data may become "\r
+                "exposed to the host during this period.");\r
             m_sEnabledBy = sEnabledBy;\r
         } else {\r
             m_sEnabledBy = "";\r