]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_customtitle.cpp
Fix Doxygen syntax errors.
[user/henk/code/inspircd.git] / src / modules / m_customtitle.cpp
index fc99cd29f24416302d1e5ffbe50f7a6b6f0a410f..fd5ec6f0955f065883c2172905d1353c525fccc2 100644 (file)
@@ -1,16 +1,24 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Pippijn van Steenhoven <pip88nl@gmail.com>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * 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 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/>.
  */
 
+
 #include "inspircd.h"
 
 /* $ModDesc: Provides the TITLE command which allows setting of CUSTOM WHOIS TITLE line */
@@ -21,7 +29,7 @@ class CommandTitle : public Command
 {
  public:
        StringExtItem ctitle;
-       CommandTitle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"TITLE",0,2),
+       CommandTitle(Module* Creator) : Command(Creator,"TITLE", 2),
                ctitle("ctitle", Creator)
        {
                syntax = "<user> <password>";
@@ -50,17 +58,17 @@ class CommandTitle : public Command
                snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(), user->host.c_str());
                snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(), user->GetIPString());
 
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                for (int i=0; i<Conf.Enumerate("title"); i++)
                {
-                       std::string name = Conf.ReadValue("title", "name", "", i);
+                       std::string Name = Conf.ReadValue("title", "name", "", i);
                        std::string pass = Conf.ReadValue("title", "password", "", i);
                        std::string hash = Conf.ReadValue("title", "hash", "", i);
                        std::string host = Conf.ReadValue("title", "host", "*@*", i);
                        std::string title = Conf.ReadValue("title", "title", "", i);
                        std::string vhost = Conf.ReadValue("title", "vhost", "", i);
 
-                       if (!strcmp(name.c_str(),parameters[0].c_str()) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1].c_str(), hash.c_str()) && OneOfMatches(TheHost,TheIP,host.c_str()) && !title.empty())
+                       if (!strcmp(Name.c_str(),parameters[0].c_str()) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1].c_str(), hash.c_str()) && OneOfMatches(TheHost,TheIP,host.c_str()) && !title.empty())
                        {
                                ctitle.set(user, title);
 
@@ -86,10 +94,10 @@ class ModuleCustomTitle : public Module
        CommandTitle cmd;
 
  public:
-       ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(Me, this)
+       ModuleCustomTitle() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
-               Extensible::Register(&cmd.ctitle);
+               ServerInstance->Extensions.Register(&cmd.ctitle);
                ServerInstance->Modules->Attach(I_OnWhoisLine, this);
        }
 
@@ -116,7 +124,7 @@ class ModuleCustomTitle : public Module
 
        Version GetVersion()
        {
-               return Version("Custom Title for users", VF_COMMON | VF_VENDOR);
+               return Version("Custom Title for users", VF_OPTCOMMON | VF_VENDOR);
        }
 };