+ for (AliasMap::iterator i = iters.first; i != iters.second; ++i)
+ {
+ if (i->second.UserCommand)
+ {
+ if (DoAlias(user, NULL, &(i->second), compare, original_line))
+ {
+ return MOD_RES_DENY;
+ }
+ }
+ }
+
+ // If we made it here, no aliases actually matched.
+ return MOD_RES_PASSTHRU;
+ }
+
+ void OnUserMessage(User *user, void *dest, int target_type, const std::string &text, char status, const CUList &exempt_list, MessageType msgtype) CXX11_OVERRIDE
+ {
+ if ((target_type != TYPE_CHANNEL) || (msgtype != MSG_PRIVMSG))
+ {
+ return;
+ }
+
+ // fcommands are only for local users. Spanningtree will send them back out as their original cmd.
+ if (!IS_LOCAL(user))
+ {
+ return;
+ }
+
+ /* Stop here if the user is +B and allowbot is set to no. */
+ if (!AllowBots && user->IsModeSet(botmode))
+ {
+ return;
+ }
+
+ 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());