]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_who.cpp
Change the syntax of FOREACH macros to be less dumb.
[user/henk/code/inspircd.git] / src / commands / cmd_who.cpp
index a78f03793e167c0a56667cb2361f0340ab35840b..5e0e55b66865abfb0a9c31efa5164e18e316c129 100644 (file)
@@ -41,6 +41,7 @@ class CommandWho : public Command
        bool opt_time;
        ChanModeReference secretmode;
        ChanModeReference privatemode;
+       UserModeReference invisiblemode;
 
        Channel* get_first_visible_channel(User *u)
        {
@@ -61,6 +62,7 @@ class CommandWho : public Command
                : Command(parent, "WHO", 1)
                , secretmode(parent, "secret")
                , privatemode(parent, "private")
+               , invisiblemode(parent, "invisible")
        {
                syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]";
        }
@@ -227,7 +229,7 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms,
 
        wholine.append(" :0 " + u->fullname);
 
-       FOREACH_MOD(I_OnSendWhoLine, OnSendWhoLine(user, parms, u, wholine));
+       FOREACH_MOD(OnSendWhoLine, (user, parms, u, wholine));
 
        if (!wholine.empty())
                whoresults.push_back(wholine);
@@ -336,7 +338,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                                continue;
 
                                        /* If we're not inside the channel, hide +i users */
-                                       if (i->first->IsModeSet('i') && !inside && !user->HasPrivPermission("users/auspex"))
+                                       if (i->first->IsModeSet(invisiblemode) && !inside && !user->HasPrivPermission("users/auspex"))
                                                continue;
                                }
 
@@ -358,7 +360,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                {
                                        if (!user->SharesChannelWith(oper))
                                        {
-                                               if (usingwildcards && (!oper->IsModeSet('i')) && (!user->HasPrivPermission("users/auspex")))
+                                               if (usingwildcards && (!oper->IsModeSet(invisiblemode)) && (!user->HasPrivPermission("users/auspex")))
                                                        continue;
                                        }
 
@@ -374,7 +376,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                {
                                        if (!user->SharesChannelWith(i->second))
                                        {
-                                               if (usingwildcards && (i->second->IsModeSet('i')) && (!user->HasPrivPermission("users/auspex")))
+                                               if (usingwildcards && (i->second->IsModeSet(invisiblemode)) && (!user->HasPrivPermission("users/auspex")))
                                                        continue;
                                        }