]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_who.cpp
Added the <cloak:ipalways> and <cloak:lowercase> options. Patch by nenolod
[user/henk/code/inspircd.git] / src / cmd_who.cpp
index 31e8030f5d0fc470396fdaf95e8c098f8c7ea3a1..b8f0684fff6a5d8389d91b8e505c6c125d44b7b2 100644 (file)
@@ -18,8 +18,7 @@
 #include "wildcard.h"
 #include "commands/cmd_who.h"
 
-/* get the last 'visible' chan of a user */
-static char *getlastchanname(userrec *u)
+static char *get_first_visible_channel(userrec *u)
 {
        UCListIter i = u->chans.begin();
        if (i != u->chans.end())
@@ -136,7 +135,7 @@ bool cmd_who::CanView(chanrec* chan, userrec* user)
 
 void cmd_who::SendWhoLine(userrec* user, const std::string &initial, chanrec* ch, userrec* u, std::vector<std::string> &whoresults)
 {
-       std::string lcn = getlastchanname(u);
+       std::string lcn = get_first_visible_channel(u);
        chanrec* chlast = ServerInstance->FindChan(lcn);
 
        /* Not visible to this user */
@@ -303,7 +302,7 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
                        {
                                if (whomatch(i->second, matchtext))
                                {
-                                       if ((i->second->IsModeSet('i')) && (!IS_OPER(user)))
+                                       if ((i->second != user) && (i->second->IsModeSet('i')) && (!IS_OPER(user)))
                                                continue;
 
                                        SendWhoLine(user, initial, NULL, i->second, whoresults);