X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_abbreviation.cpp;h=1e8f7117669083465047b6094584acb5233e5628;hb=cf9fb00675cac902751f922018e4827f425dbca1;hp=7234b5bfc39740800e51810058046be967bf8f78;hpb=cd712c40e1b352c05e7ae0f72e0a5e84cdf64323;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp index 7234b5bfc..1e8f71176 100644 --- a/src/modules/m_abbreviation.cpp +++ b/src/modules/m_abbreviation.cpp @@ -1,29 +1,36 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 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: - - ModuleAbbreviation() - { + void init() + { ServerInstance->Modules->Attach(I_OnPreCommand, this); - /* Must do this first */ + } + + void Prioritize() + { ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_FIRST); } @@ -32,7 +39,7 @@ class ModuleAbbreviation : public Module 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() != '.') @@ -72,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; }