From a068c47d71e9a922b145b7552b3a64d638c92171 Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 18 Sep 2009 17:07:13 +0000 Subject: Separate spy channels [jackmcbarn] git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11747 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index b361205da..fd0c168d9 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1661,21 +1661,18 @@ void User::SendAll(const char* command, const char* text, ...) } -std::string User::ChannelList(User* source) +std::string User::ChannelList(User* source, bool spy) { std::string list; for (UCListIter i = this->chans.begin(); i != this->chans.end(); i++) { Channel* c = *i; - /* If the target is the same as the sender, let them see all their channels. - * If the channel is NOT private/secret OR the user shares a common channel - * If the user is an oper, and the option is set. + /* If the target is the sender, neither +p nor +s is set, or + * the channel contains the user, it is not a spy channel */ - if ((source == this) || (IS_OPER(source) && ServerInstance->Config->OperSpyWhois) || (((!c->IsModeSet('p')) && (!c->IsModeSet('s'))) || (c->HasUser(source)))) - { + if (spy != (source == this || !(c->IsModeSet('p') || c->IsModeSet('s')) || c->HasUser(source))) list.append(c->GetPrefixChar(this)).append(c->name).append(" "); - } } return list; -- cgit v1.2.3