1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 /* $ModDesc: Provides the ability to abbreviate commands. */
19 class ModuleAbbreviation : public Module
24 ModuleAbbreviation(InspIRCd* Me)
27 Me->Modules->Attach(I_OnPreCommand, this);
28 /* Must do this first */
29 Me->Modules->SetPriority(this, I_OnPreCommand, PRIO_FIRST);
32 virtual Version GetVersion()
34 return Version(1,2,0,0,VF_VENDOR,API_VERSION);
37 virtual int OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
39 /* Command is already validated, has a length of 0, or last character is not a . */
40 if (validated || command.empty() || *command.rbegin() != '.')
43 /* Whack the . off the end */
44 command.erase(command.end() - 1);
46 ServerInstance->Logs->Log("m_abbreviation", DEBUG, "Abbreviated command: %s", command.c_str());
50 MODULE_INIT(ModuleAbbreviation)