summaryrefslogtreecommitdiff
path: root/src/modules/m_safelist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_safelist.cpp')
-rw-r--r--src/modules/m_safelist.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index 09e7dc183..c945bc9d9 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -101,10 +101,15 @@ class ListTimer : public InspTimer
if ((chan) && (((!(chan->binarymodes & CM_PRIVATE)) && (!(chan->binarymodes & CM_SECRET))) || (has_user)))
{
/* Increment total plus linefeed */
- int counter = snprintf(buffer,MAXBUF,"322 %s %s %d :[+%s] %s",u->nick,chan->name,usercount_i(chan),chanmodes(chan,has_user),chan->topic);
- amount_sent += counter + 4 + Srv->GetServerName().length();
- log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax);
- WriteServ_NoFormat(u->fd,buffer);
+ long users = usercount_i(chan);
+ /* If there are only invisible users on the channel, dont show it */
+ if (users)
+ {
+ int counter = snprintf(buffer,MAXBUF,"322 %s %s %d :[+%s] %s",u->nick,chan->name,users,chanmodes(chan,has_user),chan->topic);
+ amount_sent += counter + 4 + Srv->GetServerName().length();
+ log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax);
+ WriteServ_NoFormat(u->fd,buffer);
+ }
}
else
{