+ if (target_type != TYPE_CHANNEL)
+ return MOD_RES_PASSTHRU;
+
+ Channel* chan = static_cast<Channel*>(dest);
+ bool is_bypasschar = (deaf_bypasschars.find(text[0]) != std::string::npos);
+ bool is_bypasschar_uline = (deaf_bypasschars_uline.find(text[0]) != std::string::npos);
+
+ /*
+ * If we have no bypasschars_uline in config, and this is a bypasschar (regular)
+ * Than it is obviously going to get through +d, no build required
+ */
+ if (!deaf_bypasschars_uline.empty() && is_bypasschar)
+ return MOD_RES_PASSTHRU;
+
+ const Channel::MemberMap& ulist = chan->GetUsers();
+ for (Channel::MemberMap::const_iterator i = ulist.begin(); i != ulist.end(); ++i)
+ {
+ /* not +d ? */
+ if (!i->first->IsModeSet(m1))
+ continue; /* deliver message */
+ /* matched both U-line only and regular bypasses */
+ if (is_bypasschar && is_bypasschar_uline)
+ continue; /* deliver message */
+
+ bool is_a_uline = i->first->server->IsULine();
+ /* matched a U-line only bypass */
+ if (is_bypasschar_uline && is_a_uline)
+ continue; /* deliver message */
+ /* matched a regular bypass */
+ if (is_bypasschar && !is_a_uline)
+ continue; /* deliver message */
+
+ if (status && !strchr(i->second->GetAllPrefixChars(), status))
+ continue;
+
+ /* don't deliver message! */
+ exempt_list.insert(i->first);
+ }
+
+ return MOD_RES_PASSTHRU;