]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_who.cpp
Convert more by-values to const references, optimise ConfigReader a bit
[user/henk/code/inspircd.git] / src / cmd_who.cpp
index c25fa611d13cadee5cd5a27537efeeb835772513..4a94dc659ed49ffb23cdc876cbf5ebae6546f450 100644 (file)
@@ -71,12 +71,12 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
        {
                if ((IS_SINGLE(parameters[0],'0')) || (IS_SINGLE(parameters[0],'*')))
                {
-                       if ((user->chans.size()) && (user->chans[0].channel))
+                       if ((user->chans.size()) && (((ucrec*)*(user->chans.begin()))->channel))
                        {
                                int n_list = 0;
                                for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
                                {
-                                       Ptr = i->second->chans[0].channel;
+                                       Ptr = ((ucrec*)*(i->second->chans.begin()))->channel;
                                        // suggested by phidjit and FCS
                                        if ((!common_channels(user,i->second)) && (isnick(i->second->nick)))
                                        {
@@ -156,7 +156,7 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
                                        charlcat(tmp, 'H' ,9);
                                }
                                if (*u->oper) { charlcat(tmp, '*' ,9); }
-                               WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, u->chans.size() && u->chans[0].channel ? u->chans[0].channel->name
+                               WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, u->chans.size() && ((ucrec*)*(u->chans.begin()))->channel ? ((ucrec*)*(u->chans.begin()))->channel->name
                                 : "*", u->ident, u->dhost, u->server, u->nick, tmp, u->fullname);
                        }
                        WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, parameters[0]);
@@ -177,7 +177,7 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
                                } else {
                                        charlcat(tmp, 'H' ,9);
                                }
-                                WriteServ(user->fd,"352 %s %s %s %s %s %s %s* :0 %s", user->nick, oper->chans.size() && oper->chans[0].channel ? oper->chans[0].channel->name 
+                                WriteServ(user->fd,"352 %s %s %s %s %s %s %s* :0 %s", user->nick, oper->chans.size() && ((ucrec*)*(oper->chans.begin()))->channel ? ((ucrec*)*(oper->chans.begin()))->channel->name
                                : "*", oper->ident, oper->dhost, oper->server, oper->nick, tmp, oper->fullname);
                         }
                         WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, parameters[0]);