diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:30:47 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:30:47 +0000 |
commit | 91df762e93212958db487d8517addba1a63a4ddd (patch) | |
tree | 62ef9a5e926a0ba1dac698c742faf5908da400fb /src/commands/cmd_who.cpp | |
parent | 6d57bbe05c31c79eaad02fe81cfb9c1ed6b79c58 (diff) |
Membership* changes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11697 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands/cmd_who.cpp')
-rw-r--r-- | src/commands/cmd_who.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 329c0a2d5..ff39c4552 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -13,14 +13,6 @@ #include "inspircd.h" -#ifndef __CMD_WHO_H__ -#define __CMD_WHO_H__ - -// include the common header files - -#include "users.h" -#include "channels.h" - /** Handle /WHO. These command handlers can be reloaded by the core, * and handle basic RFC1459 commands. Commands within modules work * the same way, however, they can be fully unloaded, where these @@ -57,18 +49,17 @@ class CommandWho : public Command bool whomatch(User* cuser, User* user, const char* matchtext); }; -#endif - static const std::string star = "*"; static const std::string& get_first_visible_channel(User *u) { UCListIter i = u->chans.begin(); - if (i != u->chans.end()) + while (i != u->chans.end()) { - if (!i->first->IsModeSet('s')) - return i->first->name; + Channel* c = *i++; + if (!c->IsModeSet('s')) + return c->name; } return star; @@ -334,9 +325,9 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * bool inside = ch->HasUser(user); /* who on a channel. */ - CUList *cu = ch->GetUsers(); + const UserMembList *cu = ch->GetUsers(); - for (CUList::iterator i = cu->begin(); i != cu->end(); i++) + for (UserMembCIter i = cu->begin(); i != cu->end(); i++) { /* None of this applies if we WHO ourselves */ if (user != i->first) |