- void BuildDeafList(MessageType message_type, Channel* chan, User* sender, char status, const std::string &text, CUList &exempt_list)
- {
- const UserMembList *ulist = chan->GetUsers();
- bool is_a_uline;
- bool is_bypasschar, is_bypasschar_avail;
- bool is_bypasschar_uline, is_bypasschar_uline_avail;
-
- is_bypasschar = is_bypasschar_avail = is_bypasschar_uline = is_bypasschar_uline_avail = 0;
- if (!deaf_bypasschars.empty())
- {
- is_bypasschar_avail = 1;
- if (deaf_bypasschars.find(text[0], 0) != std::string::npos)
- is_bypasschar = 1;
- }
- if (!deaf_bypasschars_uline.empty())
- {
- is_bypasschar_uline_avail = 1;
- if (deaf_bypasschars_uline.find(text[0], 0) != std::string::npos)
- is_bypasschar_uline = 1;
- }
-
- /*
- * 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 (!is_bypasschar_uline_avail && is_bypasschar)
- return;
-
- for (UserMembCIter 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 */
-
- is_a_uline = ServerInstance->ULine(i->first->server);
- /* 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(chan->GetAllPrefixChars(i->first), status))
- continue;
-
- /* don't deliver message! */
- exempt_list.insert(i->first);
- }
- }
-