public:
User_d(InspIRCd* Instance) : ModeHandler(Instance, 'd', 0, 0, false, MODETYPE_USER, 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)
{
virtual void BuildDeafList(MessageType message_type, Channel* chan, User* sender, char status, const std::string &text, CUList &exempt_list)
{
- CUList *ulist;
+ CUList *ulist = chan->GetUsers();
bool is_a_uline;
bool is_bypasschar, is_bypasschar_avail;
bool is_bypasschar_uline, is_bypasschar_uline_avail;
if (!deaf_bypasschars.empty())
{
is_bypasschar_avail = 1;
- if (deaf_bypasschars.find(text[0], 0) != string::npos)
+ 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) != string::npos)
+ if (deaf_bypasschars_uline.find(text[0], 0) != std::string::npos)
is_bypasschar_uline = 1;
}
if (!is_bypasschar_uline_avail && is_bypasschar)
return;
- switch (status)
- {
- case '@':
- ulist = chan->GetOppedUsers();
- break;
- case '%':
- ulist = chan->GetHalfoppedUsers();
- break;
- case '+':
- ulist = chan->GetVoicedUsers();
- break;
- default:
- ulist = chan->GetUsers();
- break;
- }
-
for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
{
/* not +d ? */
if (is_bypasschar && !is_a_uline)
continue; /* deliver message */
+ if (status && !strchr(chan->GetAllPrefixChars(i->first), status))
+ continue;
+
/* don't deliver message! */
exempt_list[i->first] = i->first->nick;
}
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);
}
};