diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-06-18 19:10:07 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-07-19 19:40:04 +0200 |
commit | fd1d19d6345943ecdb5ce4ef947f9b3c5c8bca86 (patch) | |
tree | 20ce1866b482808a85b34c7c09e53c3159617bc0 /src/commands/cmd_who.cpp | |
parent | 882084defcc43c876ecb10e30086b63ac074fcad (diff) |
Replace hardcoded mode letters, part 3
This changes most remaining User::IsModeSet() calls to use ModeReferences for modes that were created by other modules or the core
Diffstat (limited to 'src/commands/cmd_who.cpp')
-rw-r--r-- | src/commands/cmd_who.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index a78f03793..302393927 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -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]"; } @@ -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; } |