From b9cd0dda015d86d65e01f14ee50b3671ac40f8ff Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 16:06:20 +0000 Subject: TranslateUIDs now correctly returns number of substitutions made git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7893 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/command_parse.cpp') 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; } -- cgit v1.2.3