From cd2406617f5c0c3c5e7f53519ea47b9178b7802a Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 15:14:27 +0000 Subject: More translation stuff git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7888 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index fb89fd7ad..9cef16ef4 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -594,3 +594,31 @@ void CommandParser::SetupCommandTable(userrec* user) this->CreateCommand(new cmd_reload(ServerInstance)); } +int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, std::string &dest) +{ + userrec* user = NULL; + switch (to) + { + case TR_NICK: + /* Translate single nickname */ + user = ServerInstance->FindNick(source); + if (user) + dest = user->uuid; + else + dest = source; + break; + case TR_NICKLIST: + /* Translate comma seperated list of nicknames */ + break; + case TR_SPACENICKLIST: + /* Translate space seperated list of nicknames */ + break; + case TR_END: + case TR_TEXT: + default: + /* Do nothing */ + dest = source; + break; + } +} + -- cgit v1.3.1-10-gc9f91