diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-04 18:50:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-04 18:50:09 +0000 |
commit | 369aef56c68aecccac7c3c30108fd958cfdc62f0 (patch) | |
tree | 8307db770ef949cf64d9f3c0886a1a52f6b4f37e /src/modules/m_deaf.cpp | |
parent | fc8fb6b916e4dbb155af3e54a3c1cd5308fdf5e6 (diff) |
Allow for custom prefixes as status chars in /notice @#chan etc. Up until now theyve just used a hard coded check on @%+. This slows down writing to a channels users by a small amount, but only when writing to a prefix is happening.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9329 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_deaf.cpp')
-rw-r--r-- | src/modules/m_deaf.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 6431462f3..179a443a7 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -109,7 +109,7 @@ class ModuleDeaf : public Module 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; @@ -135,22 +135,6 @@ class ModuleDeaf : public Module 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 ? */ @@ -168,6 +152,9 @@ class ModuleDeaf : public Module 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; } |