X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alias.cpp;h=6cb336c83b73967dbb71d48ff7a6995268e6c858;hb=97e8518c1961c3d1ff7b3a0ad4e04ee2880c1fc4;hp=3bd6153eac8a2fdba77edcc44a72e28faa4ca999;hpb=cd712c40e1b352c05e7ae0f72e0a5e84cdf64323;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 3bd6153ea..6cb336c83 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -1,16 +1,25 @@ -/* +------------------------------------+ - * | 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) 2009 Daniel De Graaf + * Copyright (C) 2005, 2009 Robin Burchell + * Copyright (C) 2004-2007, 2009 Craig Edwards + * Copyright (C) 2007 Dennis Friis * - * 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 aliases of commands. */ @@ -78,12 +87,13 @@ class ModuleAlias : public Module { ConfigTag* tag = i->second; Alias a; - a.AliasedCommand = tag->getString("text").c_str(); + std::string aliastext = tag->getString("text"); + a.AliasedCommand = aliastext.c_str(); tag->readString("replace", a.ReplaceFormat, true); a.RequiredNick = tag->getString("requires"); a.ULineOnly = tag->getBool("uline"); - a.ChannelCommand = tag->getBool("channelcommand", "no"); - a.UserCommand = tag->getBool("usercommand", "yes"); + a.ChannelCommand = tag->getBool("channelcommand", false); + a.UserCommand = tag->getBool("usercommand", true); a.OperOnly = tag->getBool("operonly"); a.format = tag->getString("format"); a.CaseSensitive = tag->getBool("matchcase"); @@ -135,7 +145,7 @@ class ModuleAlias : public Module return word; } - 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) { std::multimap::iterator i, upperbound;