summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 18:50:09 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 18:50:09 +0000
commit369aef56c68aecccac7c3c30108fd958cfdc62f0 (patch)
tree8307db770ef949cf64d9f3c0886a1a52f6b4f37e /src/channels.cpp
parentfc8fb6b916e4dbb155af3e54a3c1cd5308fdf5e6 (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/channels.cpp')
-rw-r--r--src/channels.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 52e8faca9..c03a69ace 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -721,25 +721,9 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList
void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const std::string &text)
{
- CUList *ulist;
+ CUList *ulist = this->GetUsers();
char tb[MAXBUF];
- switch (status)
- {
- case '@':
- ulist = this->GetOppedUsers();
- break;
- case '%':
- ulist = this->GetHalfoppedUsers();
- break;
- case '+':
- ulist = this->GetVoicedUsers();
- break;
- default:
- ulist = this->GetUsers();
- break;
- }
-
snprintf(tb,MAXBUF,":%s %s",user->GetFullHost(),text.c_str());
std::string out = tb;
@@ -747,6 +731,10 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList
{
if ((IS_LOCAL(i->first)) && (except_list.find(i->first) == except_list.end()))
{
+ /* User doesnt have the status we're after */
+ if (status && !strchr(this->GetAllPrefixChars(i->first), status))
+ continue;
+
if (serversource)
i->first->WriteServ(text);
else