]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_who.cpp
Fuck. Press save, then commit.
[user/henk/code/inspircd.git] / src / cmd_who.cpp
index 6376d8dffa0717161689273cdf2a77acdf2e6082..0ebe20d101805907588569f1a83e6e624ecf9722 100644 (file)
  */
 
 #include "inspircd.h"
-#include "configreader.h"
-#include "users.h"
-#include "modules.h"
 #include "wildcard.h"
 #include "commands/cmd_who.h"
 
-static char *get_first_visible_channel(userrec *u)
+static char *get_first_visible_channel(User *u)
 {
        UCListIter i = u->chans.begin();
        if (i != u->chans.end())
@@ -30,7 +27,7 @@ static char *get_first_visible_channel(userrec *u)
        return "*";
 }
 
-bool cmd_who::whomatch(userrec* user, const char* matchtext)
+bool cmd_who::whomatch(User* user, const char* matchtext)
 {
        bool realhost = false;
        bool realname = false;
@@ -110,12 +107,12 @@ bool cmd_who::whomatch(userrec* user, const char* matchtext)
 
 
 
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
 {
        return new cmd_who(Instance);
 }
 
-bool cmd_who::CanView(chanrec* chan, userrec* user)
+bool cmd_who::CanView(Channel* chan, User* user)
 {
        if (!user || !chan)
                return false;
@@ -135,10 +132,10 @@ bool cmd_who::CanView(chanrec* chan, userrec* user)
        return false;
 }
 
-void cmd_who::SendWhoLine(userrec* user, const std::string &initial, chanrec* ch, userrec* u, std::vector<std::string> &whoresults)
+void cmd_who::SendWhoLine(User* user, const std::string &initial, Channel* ch, User* u, std::vector<std::string> &whoresults)
 {
        std::string lcn = get_first_visible_channel(u);
-       chanrec* chlast = ServerInstance->FindChan(lcn);
+       Channel* chlast = ServerInstance->FindChan(lcn);
 
        /* Not visible to this user */
        if (u->Visibility && !u->Visibility->VisibleTo(user))
@@ -168,7 +165,7 @@ void cmd_who::SendWhoLine(userrec* user, const std::string &initial, chanrec* ch
        whoresults.push_back(wholine);
 }
 
-CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
+CmdResult cmd_who::Handle (const char** parameters, int pcnt, User *user)
 {
        /*
         * XXX - RFC says:
@@ -190,7 +187,7 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
        opt_local = false;
        opt_far = false;
 
-       chanrec *ch = NULL;
+       Channel *ch = NULL;
        std::vector<std::string> whoresults;
        std::string initial = "352 " + std::string(user->nick) + " ";
 
@@ -298,9 +295,9 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
                if (opt_viewopersonly)
                {
                        /* Showing only opers */
-                       for (std::vector<userrec*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
+                       for (std::list<User*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
                        {
-                               userrec* oper = *i;
+                               User* oper = *i;
 
                                if (whomatch(oper, matchtext))
                                {