public:
BlockColor(InspIRCd* Instance) : ModeHandler(Instance, 'c', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
{
if (adding)
{
if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
{
Channel* c = (Channel*)dest;
+
+ if (CHANOPS_EXEMPT(ServerInstance, 'c') && c->GetStatus(user) == STATUS_OP)
+ {
+ return 0;
+ }
if(c->IsModeSet('c'))
{
- if (!CHANOPS_EXEMPT(ServerInstance, 'c') || CHANOPS_EXEMPT(ServerInstance, 'c') && c->GetStatus(user) != STATUS_OP)
+ for (std::string::iterator i = text.begin(); i != text.end(); i++)
{
- for (std::string::iterator i = text.begin(); i != text.end(); i++)
+ switch (*i)
{
- switch (*i)
- {
- case 2:
- case 3:
- case 15:
- case 21:
- case 22:
- case 31:
- user->WriteServ("404 %s %s :Can't send colours to channel (+c set)",user->nick, c->name);
- return 1;
- break;
- }
+ case 2:
+ case 3:
+ case 15:
+ case 21:
+ case 22:
+ case 31:
+ user->WriteNumeric(404, "%s %s :Can't send colours to channel (+c set)",user->nick, c->name);
+ return 1;
+ break;
}
}
}
virtual Version GetVersion()
{
- return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+ return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
}
};