+ this->CreateCommand(new CommandReload(ServerInstance));
+}
+
+int CommandParser::TranslateUIDs(const std::vector<TranslateType> to, const std::vector<std::string> &source, std::string &dest, bool prefix_final, Command* custom_translator)
+{
+ std::vector<TranslateType>::const_iterator types = to.begin();
+ User* user = NULL;
+ unsigned int i;
+ int translations = 0;
+ dest.clear();
+
+ for(i=0; i < source.size(); i++)
+ {
+ TranslateType t;
+ std::string item = source[i];
+
+ if (types == to.end())
+ t = TR_TEXT;
+ else
+ {
+ t = *types;
+ types++;
+ }
+
+ if (prefix_final && i == source.size() - 1)
+ dest.append(":");
+
+ switch (t)
+ {
+ case TR_NICK:
+ /* Translate single nickname */
+ user = ServerInstance->FindNick(item);
+ if (user)
+ {
+ dest.append(user->uuid);
+ translations++;
+ }
+ else
+ dest.append(item);
+ break;
+ case TR_CUSTOM:
+ if (custom_translator)
+ custom_translator->EncodeParameter(item, i);
+ dest.append(item);
+ break;
+ case TR_END:
+ case TR_TEXT:
+ default:
+ /* Do nothing */
+ dest.append(item);
+ break;
+ }
+ if (i != source.size() - 1)
+ dest.append(" ");
+ }
+
+ return translations;