: ClientProtocol::Message("SILENCE")
{
PushParam(mask);
- PushParamRef(flags);
+ PushParam(flags);
}
};
SilenceList* list = ext.get(user);
if (list && list->size() > maxsilence)
{
- user->WriteNumeric(ERR_SILELISTFULL, mask, SilenceEntry::BitsToFlags(flags), "Your silence list is full");
+ user->WriteNumeric(ERR_SILELISTFULL, mask, SilenceEntry::BitsToFlags(flags), "Your SILENCE list is full");
return CMD_FAILURE;
}
else if (!list)
if (!list->insert(SilenceEntry(flags, mask)).second)
{
- user->WriteNumeric(ERR_SILENCE, mask, SilenceEntry::BitsToFlags(flags), "The silence entry you specified already exists");
+ user->WriteNumeric(ERR_SILENCE, mask, SilenceEntry::BitsToFlags(flags), "The SILENCE entry you specified already exists");
return CMD_FAILURE;
}
}
}
- user->WriteNumeric(ERR_SILENCE, mask, SilenceEntry::BitsToFlags(flags), "The silence entry you specified could not be found");
+ user->WriteNumeric(ERR_SILENCE, mask, SilenceEntry::BitsToFlags(flags), "The SILENCE entry you specified could not be found");
return CMD_FAILURE;
}
user->WriteNumeric(RPL_SILELIST, iter->mask, SilenceEntry::BitsToFlags(iter->flags));
}
}
- user->WriteNumeric(RPL_ENDOFSILELIST, "End of silence list");
+ user->WriteNumeric(RPL_ENDOFSILELIST, "End of SILENCE list");
return CMD_SUCCESS;
}
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<Channel>(), 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<User>(), 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<Channel>(), 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<User>(), flag))
+ {
+ details.echo_original = true;
+ return MOD_RES_DENY;
+ }
+ break;
}
+ case MessageTarget::TYPE_SERVER:
+ break;
}
return MOD_RES_PASSTHRU;
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides support for blocking users with the /SILENCE command", VF_OPTCOMMON | VF_VENDOR);
+ return Version("Provides support for blocking users with the SILENCE command", VF_OPTCOMMON | VF_VENDOR);
}
};