+ std::string output_text = CommandParser::TranslateUIDs(thiscmd->translation, parameters, true, thiscmd);
+
+ params.push_back(output_text);
+
+ if (routing.type == ROUTE_TYPE_MESSAGE)
+ {
+ char pfx = 0;
+ std::string dest = routing.serverdest;
+ if (ServerInstance->Modes->FindPrefix(dest[0]))
+ {
+ pfx = dest[0];
+ dest.erase(dest.begin());
+ }
+ if (dest[0] == '#')
+ {
+ Channel* c = ServerInstance->FindChan(dest);
+ if (!c)
+ return;
+ // TODO OnBuildExemptList hook was here
+ CUList exempts;
+ SendChannelMessage(user->uuid, c, parameters[1], pfx, exempts, command.c_str(), origin ? origin->GetSocket() : NULL);
+ }
+ else if (dest[0] == '$')
+ {
+ params.Forward(origin);
+ }
+ else
+ {
+ // user target?
+ User* d = ServerInstance->FindNick(dest);
+ if (!d || IS_LOCAL(d))
+ return;
+ TreeServer* tsd = TreeServer::Get(d)->GetRoute();
+ if (tsd == origin)
+ // huh? no routing stuff around in a circle, please.
+ return;
+ params.Unicast(d);
+ }
+ }
+ else if (routing.type == ROUTE_TYPE_BROADCAST || routing.type == ROUTE_TYPE_OPT_BCAST)
+ {
+ params.Forward(origin);
+ }
+ else if (routing.type == ROUTE_TYPE_UNICAST || routing.type == ROUTE_TYPE_OPT_UCAST)
+ {
+ params.Unicast(sdest->ServerUser);
+ }
+}