X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_silence.cpp;h=1e73bda27569b82cdf350d066d5f25a39892c4c8;hb=4e3d655dff6f8a5aed626475fbf19c2a7119c20b;hp=87b70dfa46451d6922f5b4397876ed0d2541d839;hpb=7b47de3c194f239c5fea09a0e49696c9af017d51;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 87b70dfa4..1e73bda27 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -384,32 +384,38 @@ class ModuleSilence bool is_ctcp = details.IsCTCP(ctcpname) && !irc::equals(ctcpname, "ACTION"); SilenceEntry::SilenceFlags flag = SilenceEntry::SF_NONE; - if (target.type == MessageTarget::TYPE_CHANNEL) - { - if (is_ctcp) - flag = SilenceEntry::SF_CTCP_CHANNEL; - else if (details.type == MSG_NOTICE) - flag = SilenceEntry::SF_NOTICE_CHANNEL; - else if (details.type == MSG_PRIVMSG) - flag = SilenceEntry::SF_PRIVMSG_CHANNEL; - - return BuildChannelExempts(user, target.Get(), flag, details.exemptions); - } - - if (target.type == MessageTarget::TYPE_USER) + switch (target.type) { - if (is_ctcp) - flag = SilenceEntry::SF_CTCP_USER; - else if (details.type == MSG_NOTICE) - flag = SilenceEntry::SF_NOTICE_USER; - else if (details.type == MSG_PRIVMSG) - flag = SilenceEntry::SF_PRIVMSG_USER; - - if (!CanReceiveMessage(user, target.Get(), flag)) + case MessageTarget::TYPE_CHANNEL: + { + if (is_ctcp) + flag = SilenceEntry::SF_CTCP_CHANNEL; + else if (details.type == MSG_NOTICE) + flag = SilenceEntry::SF_NOTICE_CHANNEL; + else if (details.type == MSG_PRIVMSG) + flag = SilenceEntry::SF_PRIVMSG_CHANNEL; + + return BuildChannelExempts(user, target.Get(), flag, details.exemptions); + break; + } + case MessageTarget::TYPE_USER: { - details.echo_original = true; - return MOD_RES_DENY; + if (is_ctcp) + flag = SilenceEntry::SF_CTCP_USER; + else if (details.type == MSG_NOTICE) + flag = SilenceEntry::SF_NOTICE_USER; + else if (details.type == MSG_PRIVMSG) + flag = SilenceEntry::SF_PRIVMSG_USER; + + if (!CanReceiveMessage(user, target.Get(), flag)) + { + details.echo_original = true; + return MOD_RES_DENY; + } + break; } + case MessageTarget::TYPE_SERVER: + break; } return MOD_RES_PASSTHRU;