diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 15:27:35 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 15:27:35 +0000 |
commit | 036f62f864411dd5018ec718ec58a9c787cbbcfd (patch) | |
tree | 336e8866600c56ee6e1061fb6c88d8d847b4cf65 /src/command_parse.cpp | |
parent | cd2406617f5c0c3c5e7f53519ea47b9178b7802a (diff) |
Auto translation nick->uuid for command params should now work in all modules which set their translation types. None do atm.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7889 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 9cef16ef4..4bc09b3f4 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -597,6 +597,8 @@ void CommandParser::SetupCommandTable(userrec* user) int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, std::string &dest) { userrec* user = NULL; + std::string item; + switch (to) { case TR_NICK: @@ -608,10 +610,38 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st dest = source; break; case TR_NICKLIST: + { /* Translate comma seperated list of nicknames */ + irc::commasepstream items(source); + while (items.GetToken(item)) + { + user = ServerInstance->FindNick(item); + if (user) + dest.append(user->uuid); + else + dest.append(source); + dest.append(","); + } + if (!dest.empty()) + dest.erase(dest.end() - 1); + } break; case TR_SPACENICKLIST: + { /* Translate space seperated list of nicknames */ + irc::spacesepstream items(source); + while (items.GetToken(item)) + { + user = ServerInstance->FindNick(item); + if (user) + dest.append(user->uuid); + else + dest.append(source); + dest.append(" "); + } + if (!dest.empty()) + dest.erase(dest.end() - 1); + } break; case TR_END: case TR_TEXT: |