summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-07 23:00:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-07 23:00:43 +0000
commitb57568ecc46296ba3a0e06d770eceff40cc9aee4 (patch)
tree17b6807c8cd7fa30290985dfd28cd243b2b6cc7c
parentfd317e2325992c472487574d6e49749f4ea802e4 (diff)
Bad w00tie bad, /who isnt checking +s for channel /who!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5883 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/commands/cmd_who.h1
-rw-r--r--src/cmd_who.cpp15
2 files changed, 15 insertions, 1 deletions
diff --git a/include/commands/cmd_who.h b/include/commands/cmd_who.h
index 8b5bbe89e..299b70cdd 100644
--- a/include/commands/cmd_who.h
+++ b/include/commands/cmd_who.h
@@ -26,6 +26,7 @@
*/
class cmd_who : public command_t
{
+ bool CanView(chanrec* chan, userrec* user);
public:
cmd_who (InspIRCd* Instance) : command_t(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohur]"; }
CmdResult Handle(const char** parameters, int pcnt, userrec *user);
diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp
index 81145a91c..508956c44 100644
--- a/src/cmd_who.cpp
+++ b/src/cmd_who.cpp
@@ -82,6 +82,19 @@ extern "C" command_t* init_command(InspIRCd* Instance)
return new cmd_who(Instance);
}
+bool cmd_who::CanView(chanrec* chan, userrec* user)
+{
+ /* Execute items in fastest-to-execute first order */
+ if (*user->oper)
+ return true;
+ else if (!chan->IsModeSet('s') && !chan->IsModeSet('p'))
+ return true;
+ else if (chan->HasUser(user))
+ return true;
+
+ return false;
+}
+
CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
{
/*
@@ -145,7 +158,7 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
/* who on a channel? */
ch = ServerInstance->FindChan(matchtext);
- if (ch)
+ if ((ch) && (CanView(ch,user)))
{
/* who on a channel. */
CUList *cu = ch->GetUsers();