]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Don't reassign NPrefix on rehash, its change requires a reloadmodule (noticed by...
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 3 Sep 2009 02:35:12 +0000 (02:35 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 3 Sep 2009 02:35:12 +0000 (02:35 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11670 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_ojoin.cpp

index 922a93a8e57e1401ba8120104b5f0981a7c284b1..6267726ef8114bd43ae7e8c32cbc8081d7eb4f88 100644 (file)
@@ -245,7 +245,7 @@ class ModuleOjoin : public Module
  public:
 
        ModuleOjoin(InspIRCd* Me)
-               : Module(Me), mycommand(Me, this)
+               : Module(Me), np(NULL), mycommand(Me, this)
        {
                /* Load config stuff */
                OnRehash(NULL);
@@ -293,11 +293,15 @@ class ModuleOjoin : public Module
        {
                ConfigReader Conf(ServerInstance);
 
-               std::string npre = Conf.ReadValue("ojoin", "prefix", 0);
-               NPrefix = npre.empty() ? 0 : npre[0];
+               if (!np)
+               {
+                       // This is done on module load only
+                       std::string npre = Conf.ReadValue("ojoin", "prefix", 0);
+                       NPrefix = npre.empty() ? 0 : npre[0];
 
-               if (NPrefix && ServerInstance->Modes->FindPrefix(NPrefix))
-                       throw ModuleException("Looks like the +Y prefix you picked for m_ojoin is already in use. Pick another.");
+                       if (NPrefix && ServerInstance->Modes->FindPrefix(NPrefix))
+                               throw ModuleException("Looks like the +Y prefix you picked for m_ojoin is already in use. Pick another.");
+               }
 
                notice = Conf.ReadFlag("ojoin", "notice", "yes", 0);
                op = Conf.ReadFlag("ojoin", "op", "yes", 0);