summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-18 17:07:13 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-18 17:07:13 +0000
commita068c47d71e9a922b145b7552b3a64d638c92171 (patch)
treeb78e21ea491683cd2238c49f02aced889f488260 /src/users.cpp
parent792d6d6725c7d80d223f5cccd9ee0c5b07229e9a (diff)
Separate spy channels [jackmcbarn]
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11747 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp11
1 files changed, 4 insertions, 7 deletions
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 <options:operspywhois> 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;