diff options
author | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
commit | ddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch) | |
tree | 0364a76606ac6e2881ebd663601ce260f7c1101e /modules/commands/os_list.cpp | |
parent | 51c049e1a738e9124bab3961f35b830906517421 (diff) |
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'modules/commands/os_list.cpp')
-rw-r--r-- | modules/commands/os_list.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index 5fffb3f5b..7178618b6 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -26,13 +26,13 @@ class CommandOSChanList : public Command { const Anope::string &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; - std::list<ChannelModeName> Modes; + std::set<Anope::string> modes; User *u2; if (!opt.empty() && opt.equals_ci("SECRET")) { - Modes.push_back(CMODE_SECRET); - Modes.push_back(CMODE_PRIVATE); + modes.insert("SECRET"); + modes.insert("PRIVATE"); } ListFormatter list; @@ -46,8 +46,8 @@ class CommandOSChanList : public Command { ChanUserContainer *cc = *uit; - if (!Modes.empty()) - for (std::list<ChannelModeName>::iterator it = Modes.begin(), it_end = Modes.end(); it != it_end; ++it) + if (!modes.empty()) + for (std::set<Anope::string>::iterator it = modes.begin(), it_end = modes.end(); it != it_end; ++it) if (!cc->chan->HasMode(*it)) continue; @@ -69,8 +69,8 @@ class CommandOSChanList : public Command if (!pattern.empty() && !Anope::Match(c->name, pattern, false, true)) continue; - if (!Modes.empty()) - for (std::list<ChannelModeName>::iterator it = Modes.begin(), it_end = Modes.end(); it != it_end; ++it) + if (!modes.empty()) + for (std::set<Anope::string>::iterator it = modes.begin(), it_end = modes.end(); it != it_end; ++it) if (!c->HasMode(*it)) continue; @@ -124,10 +124,10 @@ class CommandOSUserList : public Command const Anope::string &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; Channel *c; - std::list<UserModeName> Modes; + std::set<Anope::string> modes; if (!opt.empty() && opt.equals_ci("INVISIBLE")) - Modes.push_back(UMODE_INVIS); + modes.insert("INVIS"); ListFormatter list; list.AddColumn("Name").AddColumn("Mask"); @@ -140,8 +140,8 @@ class CommandOSUserList : public Command { ChanUserContainer *uc = *cuit; - if (!Modes.empty()) - for (std::list<UserModeName>::iterator it = Modes.begin(), it_end = Modes.end(); it != it_end; ++it) + if (!modes.empty()) + for (std::set<Anope::string>::iterator it = modes.begin(), it_end = modes.end(); it != it_end; ++it) if (!uc->user->HasMode(*it)) continue; @@ -169,8 +169,8 @@ class CommandOSUserList : public Command Anope::string mask = u2->nick + "!" + u2->GetIdent() + "@" + u2->GetDisplayedHost(), mask2 = u2->nick + "!" + u2->GetIdent() + "@" + u2->host, mask3 = u2->nick + "!" + u2->GetIdent() + "@" + (!u2->ip.empty() ? u2->ip : u2->host); if (!Anope::Match(mask, pattern) && !Anope::Match(mask2, pattern) && !Anope::Match(mask3, pattern)) continue; - if (!Modes.empty()) - for (std::list<UserModeName>::iterator mit = Modes.begin(), mit_end = Modes.end(); mit != mit_end; ++mit) + if (!modes.empty()) + for (std::set<Anope::string>::iterator mit = modes.begin(), mit_end = modes.end(); mit != mit_end; ++mit) if (!u2->HasMode(*mit)) continue; } |