]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_passforward.cpp
Fix m_randquote with 0 quotes
[user/henk/code/inspircd.git] / src / modules / m_passforward.cpp
index fb7bae234c2c48c288104d7423f67f252b09fdbf..84389fb22a9be2e0e5b3a2ed68d29b55723172e3 100644 (file)
@@ -27,11 +27,11 @@ class ModulePassForward : public Module
        std::string nickrequired, forwardmsg, forwardcmd;
 
  public:
-       ModulePassForward()
+       void init()
        {
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnPostConnect, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        Version GetVersion()
@@ -41,10 +41,10 @@ class ModulePassForward : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf;
-               nickrequired = Conf.ReadValue("passforward", "nick", "NickServ", 0);
-               forwardmsg = Conf.ReadValue("passforward", "forwardmsg", "NOTICE $nick :*** Forwarding PASS to $nickrequired", 0);
-               forwardcmd = Conf.ReadValue("passforward", "cmd", "PRIVMSG $nickrequired :IDENTIFY $pass", 0);
+               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", "PRIVMSG $nickrequired :IDENTIFY $pass");
        }
 
        void FormatStr(std::string& result, const std::string& format, const LocalUser* user)