+ return;
+ }
+
+ Channel *c = (Channel *)dest;
+ std::string fcommand;
+
+ // text is like "!moo cows bite me", we want "!moo" first
+ irc::spacesepstream ss(text);
+ ss.GetToken(fcommand);
+
+ if (fcommand.empty())
+ {
+ return; // wtfbbq
+ }
+
+ // we don't want to touch non-fantasy stuff
+ if (*fcommand.c_str() != fprefix)
+ {
+ return;
+ }
+
+ // nor do we give a shit about the prefix
+ fcommand.erase(fcommand.begin());
+ std::transform(fcommand.begin(), fcommand.end(), fcommand.begin(), ::toupper);
+
+ std::multimap<std::string, Alias>::iterator i = Aliases.find(fcommand);
+
+ if (i == Aliases.end())
+ return;
+
+ /* Avoid iterating on to other aliases if no patterns match */
+ std::multimap<std::string, Alias>::iterator upperbound = Aliases.upper_bound(fcommand);
+
+
+ /* The parameters for the command in their original form, with the command stripped off */
+ std::string compare = text.substr(fcommand.length() + 1);
+ while (*(compare.c_str()) == ' ')
+ compare.erase(compare.begin());
+
+ while (i != upperbound)
+ {
+ if (i->second.ChannelCommand)