diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-10 19:46:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-10 19:46:53 +0000 |
commit | ff7b9e9af0a502989fa88b096b2183590193e2cc (patch) | |
tree | fde611383b4d73b776f200b806b7cb9473bf07a4 /src | |
parent | a9a27adf521b3de98dd260fbf27cc8313c8ce9e6 (diff) |
Implement a change for bug #171. It might not be pretty in the /list output, but the rfc DOES say we must do something like this.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5678 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_list.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_safelist.cpp | 14 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp index 3371fc738..5ce458ab7 100644 --- a/src/cmd_list.cpp +++ b/src/cmd_list.cpp @@ -41,11 +41,20 @@ CmdResult cmd_list::Handle (const char** parameters, int pcnt, userrec *user) continue; // if the channel is not private/secret, OR the user is on the channel anyway bool n = i->second->HasUser(user); - if (((!(i->second->modes[CM_PRIVATE])) && (!(i->second->modes[CM_SECRET]))) || (n)) + if ((i->second->modes[CM_PRIVATE]) && (!n)) { long users = i->second->GetUserCounter(); if (users) - user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic); + user->WriteServ("322 %s *",user->nick,i->second->name); + } + else + { + if (((!(i->second->modes[CM_PRIVATE])) && (!(i->second->modes[CM_SECRET]))) || (n)) + { + long users = i->second->GetUserCounter(); + if (users) + user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic); + } } } user->WriteServ("323 %s :End of channel list.",user->nick); diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index dfd864884..c32f89137 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -104,7 +104,19 @@ class ListTimer : public InspTimer chan = ServerInstance->GetChannelIndex(ld->list_position); /* spool details */ bool has_user = (chan && chan->HasUser(u)); - if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user))) + if ((chan) && (chan->modes[CM_PRIVATE])) + { + bool display = match(chan->name, ld->glob.c_str()); + long users = chan->GetUserCounter(); + if ((users) && (display)) + { + int counter = snprintf(buffer, MAXBUF, "322 %s *", u->nick); + amount_sent += counter + ServerNameSize; + ServerInstance->Log(DEBUG, "m_safelist.so: Sent %ld of safe %ld / 4", amount_sent, u->sendqmax); + u->WriteServ(std::string(buffer)); + } + } + else if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user))) { bool display = match(chan->name, ld->glob.c_str()); long users = chan->GetUserCounter(); |