diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 16:06:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 16:06:20 +0000 |
commit | b9cd0dda015d86d65e01f14ee50b3671ac40f8ff (patch) | |
tree | 9732552f8041a7f7042bd044b8f279c8ad341da5 /src | |
parent | 2b3394855d5adddb16285b905503d9ffe5a1d963 (diff) |
TranslateUIDs now correctly returns number of substitutions made
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7893 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/command_parse.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 4bc09b3f4..3ffbfe3db 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -598,6 +598,7 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st { userrec* user = NULL; std::string item; + int translations = 0; switch (to) { @@ -605,7 +606,10 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st /* Translate single nickname */ user = ServerInstance->FindNick(source); if (user) + { dest = user->uuid; + translations++; + } else dest = source; break; @@ -617,7 +621,10 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st { user = ServerInstance->FindNick(item); if (user) + { dest.append(user->uuid); + translations++; + } else dest.append(source); dest.append(","); @@ -634,7 +641,10 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st { user = ServerInstance->FindNick(item); if (user) + { dest.append(user->uuid); + translations++; + } else dest.append(source); dest.append(" "); @@ -650,5 +660,7 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st dest = source; break; } + + return translations; } |