]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_passforward.cpp
Set the minimum length to 1 for most config items with a default.
[user/henk/code/inspircd.git] / src / modules / m_passforward.cpp
index 026169270460f1feaeba13533e14f8bb52d0e3c8..abbd9893d3f4dba0efe5210a3ebe862a4a25ef31 100644 (file)
@@ -41,7 +41,7 @@ class ModulePassForward : public Module
                ConfigTag* tag = ServerInstance->Config->ConfValue("passforward");
                nickrequired = tag->getString("nick", "NickServ");
                forwardmsg = tag->getString("forwardmsg", "NOTICE $nick :*** Forwarding PASS to $nickrequired");
-               forwardcmd = tag->getString("cmd", "SQUERY $nickrequired :IDENTIFY $pass");
+               forwardcmd = tag->getString("cmd", "SQUERY $nickrequired :IDENTIFY $pass", 1);
        }
 
        void FormatStr(std::string& result, const std::string& format, const LocalUser* user)
@@ -105,11 +105,14 @@ class ModulePassForward : public Module
                }
 
                std::string tmp;
-               FormatStr(tmp, forwardmsg, user);
-               ServerInstance->Parser.ProcessBuffer(user, tmp);
+               if (!forwardmsg.empty())
+               {
+                       FormatStr(tmp, forwardmsg, user);
+                       ServerInstance->Parser.ProcessBuffer(user, tmp);
+                       tmp.clear();
+               }
 
-               tmp.clear();
-               FormatStr(tmp,forwardcmd, user);
+               FormatStr(tmp, forwardcmd, user);
                ServerInstance->Parser.ProcessBuffer(user, tmp);
        }
 };