+ Channel *c = (Channel *)dest;
+ std::string scommand;
+
+ // text is like "!moo cows bite me", we want "!moo" first
+ irc::spacesepstream ss(text);
+ ss.GetToken(scommand);
+
+ if (scommand.size() <= fprefix.size())
+ {
+ return; // wtfbbq
+ }
+
+ // we don't want to touch non-fantasy stuff
+ if (scommand.compare(0, fprefix.size(), fprefix) != 0)
+ {
+ return;
+ }
+
+ // nor do we give a shit about the prefix
+ scommand.erase(0, fprefix.size());
+
+ std::pair<AliasMap::iterator, AliasMap::iterator> iters = Aliases.equal_range(scommand);
+ if (iters.first == iters.second)
+ return;
+
+ /* The parameters for the command in their original form, with the command stripped off */
+ std::string compare(text, scommand.length() + fprefix.size());
+ while (*(compare.c_str()) == ' ')
+ compare.erase(compare.begin());
+
+ for (AliasMap::iterator i = iters.first; i != iters.second; ++i)
+ {
+ if (i->second.ChannelCommand)
+ {
+ // We use substr here to remove the fantasy prefix
+ if (DoAlias(user, c, &(i->second), compare, text.substr(fprefix.size())))
+ return;
+ }
+ }