X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_abbreviation.cpp;h=1e8f7117669083465047b6094584acb5233e5628;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=8ff325730225774e7cdec786ce55efa01c1cae67;hpb=7d93921aabd9c608821baec8a871aff844dfae49;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp index 8ff325730..1e8f71176 100644 --- a/src/modules/m_abbreviation.cpp +++ b/src/modules/m_abbreviation.cpp @@ -1,39 +1,45 @@ -/* +------------------------------------+ - * | 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) 2008 Craig Edwards * - * 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 . */ + #include "inspircd.h" /* $ModDesc: Provides the ability to abbreviate commands a-la BBC BASIC keywords. */ class ModuleAbbreviation : public Module { - public: + void init() + { + ServerInstance->Modules->Attach(I_OnPreCommand, this); + } - ModuleAbbreviation(InspIRCd* Me) - : Module(Me) + void Prioritize() { - Me->Modules->Attach(I_OnPreCommand, this); - /* Must do this first */ - Me->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_FIRST); + ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_FIRST); } virtual Version GetVersion() { - return Version("Provides the ability to abbreviate commands a-la BBC BASIC keywords.",VF_VENDOR,API_VERSION); + return Version("Provides the ability to abbreviate commands a-la BBC BASIC keywords.",VF_VENDOR); } - virtual ModResult OnPreCommand(std::string &command, std::vector ¶meters, User *user, bool validated, const std::string &original_line) + virtual ModResult OnPreCommand(std::string &command, std::vector ¶meters, LocalUser *user, bool validated, const std::string &original_line) { /* Command is already validated, has a length of 0, or last character is not a . */ if (validated || command.empty() || *command.rbegin() != '.') @@ -73,7 +79,7 @@ class ModuleAbbreviation : public Module /* Ambiguous command, list the matches */ if (!matchlist.empty()) { - user->WriteNumeric(420, "%s :Ambiguous abbreviation, posssible matches: %s%s", user->nick.c_str(), foundcommand.c_str(), matchlist.c_str()); + user->WriteNumeric(420, "%s :Ambiguous abbreviation, possible matches: %s%s", user->nick.c_str(), foundcommand.c_str(), matchlist.c_str()); return MOD_RES_DENY; }