]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ojoin.cpp
m_namesx, m_uhnames Don't convert the command name to irc::string in OnPreCommand()
[user/henk/code/inspircd.git] / src / modules / m_ojoin.cpp
index 38497f1bb640630092337895e5094e3b6e91e9f3..d4daf2b6387a8ec94d97e2901bf695cc236443cd 100644 (file)
@@ -1,16 +1,22 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * ---------------------------------------------------
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 /*
  * Written for InspIRCd-1.2 by Taros on the Tel'Laerad M&D Team
  * <http://tellaerad.net>
@@ -98,7 +104,7 @@ class NetworkPrefix : public ModeHandler
        {
                list = true;
                prefix = NPrefix;
-               levelrequired = 0xFFFFFFFF;
+               levelrequired = INT_MAX;
                m_paramtype = TR_NICK;
        }
 
@@ -200,27 +206,24 @@ class ModuleOjoin : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf;
+               ConfigTag* Conf = ServerInstance->Config->ConfValue("ojoin");
 
                if (!np)
                {
                        // This is done on module load only
-                       std::string npre = Conf.ReadValue("ojoin", "prefix", 0);
+                       std::string npre = Conf->getString("prefix");
                        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.");
                }
 
-               notice = Conf.ReadFlag("ojoin", "notice", "yes", 0);
-               op = Conf.ReadFlag("ojoin", "op", "yes", 0);
+               notice = Conf->getBool("notice", true);
+               op = Conf->getBool("op", true);
        }
 
        ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason)
        {
-               if ((ServerInstance->ULine(source->nick.c_str())) || ServerInstance->ULine(source->server))
-                       return MOD_RES_PASSTHRU;
-
                // Don't do anything if they're not +Y
                if (!memb->hasMode('Y'))
                        return MOD_RES_PASSTHRU;
@@ -245,7 +248,7 @@ class ModuleOjoin : public Module
 
        Version GetVersion()
        {
-               return Version("Network Buisness Join", VF_VENDOR);
+               return Version("Network Business Join", VF_VENDOR);
        }
 };