diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-06 13:17:06 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-06 13:17:06 +0100 |
commit | be3644c74be3f1c40be2d32c6cfcace73689e359 (patch) | |
tree | 669dd74c6f830bf30aee14b76c953cd33ec642af /src | |
parent | 9136136ac373a922cd0875f77d3212a419fb9100 (diff) |
m_deaf Simplify logic
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_deaf.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 26d5029e8..7d716de7e 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -75,29 +75,14 @@ class ModuleDeaf : public Module 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; - } + 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 (!is_bypasschar_uline_avail && is_bypasschar) + if (!deaf_bypasschars_uline.empty() && is_bypasschar) return; for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++) @@ -109,7 +94,7 @@ class ModuleDeaf : public Module if (is_bypasschar && is_bypasschar_uline) continue; /* deliver message */ - is_a_uline = i->first->server->IsULine(); + bool is_a_uline = i->first->server->IsULine(); /* matched a U-line only bypass */ if (is_bypasschar_uline && is_a_uline) continue; /* deliver message */ |