diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-06 15:47:39 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-06 15:47:39 +0000 |
commit | 61185fc62b7d3d05e33a116fca26aa9dc72ab691 (patch) | |
tree | dc3a71b2d1fa70f91400fe6d5e680d3e12e8059b /src/modules/m_abbreviation.cpp | |
parent | 8172d4afcf105b58a4b16735f5e6f8ccc5404dd5 (diff) |
m_abbreviation completed. :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9845 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_abbreviation.cpp')
-rw-r--r-- | src/modules/m_abbreviation.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp index bc04cc307..35a6082d9 100644 --- a/src/modules/m_abbreviation.cpp +++ b/src/modules/m_abbreviation.cpp @@ -45,6 +45,22 @@ class ModuleAbbreviation : public Module ServerInstance->Logs->Log("m_abbreviation", DEBUG, "Abbreviated command: %s", command.c_str()); + size_t clen = command.length(); + for (Commandtable::iterator n = ServerInstance->Parser->cmdlist.begin(); n != ServerInstance->Parser->cmdlist.end(); ++n) + { + if (n->first.length() < clen) + continue; + + ServerInstance->Logs->Log("m_abbreviation", DEBUG, "command=%s abbr=%s", command.c_str(), n->first.substr(0, clen).c_str()); + if (command == n->first.substr(0, clen)) + { + /* Found the command */ + command = n->first; + return false; + } + } + + command += '.'; return false; } }; |