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/protocol/ngircd.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/protocol/ngircd.cpp')
-rw-r--r-- | modules/protocol/ngircd.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index 52dc550ab..e54a4f8f7 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -95,11 +95,11 @@ class ngIRCdProto : public IRCDProto */ ChanUserContainer *uc = c->FindUser(user); if (uc != NULL) - uc->status.ClearFlags(); + uc->status.modes.clear(); BotInfo *setter = BotInfo::Find(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) - if (cs.HasFlag(ModeManager::ChannelModes[i]->name)) + if (cs.modes.count(ModeManager::ChannelModes[i]->name)) c->SetMode(setter, ModeManager::ChannelModes[i], user->GetUID(), false); } } @@ -157,9 +157,9 @@ class ngIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "METADATA " << u->nick << " user :" << vIdent; UplinkSocket::Message(Me) << "METADATA " << u->nick << " cloakhost :" << vhost; - if (!u->HasMode(UMODE_CLOAK)) + if (!u->HasMode("CLOAK")) { - u->SetMode(HostServ, UMODE_CLOAK); + u->SetMode(HostServ, "CLOAK"); ModeManager::ProcessModes(); } } @@ -478,7 +478,7 @@ struct IRCDMessageNJoin : IRCDMessage continue; } - sju.first.SetFlag(cm->name); + sju.first.modes.insert(cm->name); } sju.second = User::Find(buf); @@ -616,46 +616,46 @@ class ProtongIRCd : public Module void AddModes() { /* Add user modes */ - ModeManager::AddUserMode(new UserMode(UMODE_NOCTCP, 'b')); - ModeManager::AddUserMode(new UserMode(UMODE_BOT, 'B')); - ModeManager::AddUserMode(new UserMode(UMODE_COMMONCHANS, 'C')); - ModeManager::AddUserMode(new UserMode(UMODE_INVIS, 'i')); - ModeManager::AddUserMode(new UserMode(UMODE_OPER, 'o')); - ModeManager::AddUserMode(new UserMode(UMODE_PROTECTED, 'q')); - ModeManager::AddUserMode(new UserMode(UMODE_RESTRICTED, 'r')); - ModeManager::AddUserMode(new UserMode(UMODE_REGISTERED, 'R')); - ModeManager::AddUserMode(new UserMode(UMODE_SNOMASK, 's')); - ModeManager::AddUserMode(new UserMode(UMODE_WALLOPS, 'w')); - ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x')); + ModeManager::AddUserMode(new UserMode("NOCTCP", 'b')); + ModeManager::AddUserMode(new UserMode("BOT", 'B')); + ModeManager::AddUserMode(new UserMode("COMMONCHANS", 'C')); + ModeManager::AddUserMode(new UserMode("INVIS", 'i')); + ModeManager::AddUserMode(new UserMode("OPER", 'o')); + ModeManager::AddUserMode(new UserMode("PROTECTED", 'q')); + ModeManager::AddUserMode(new UserMode("RESTRICTED", 'r')); + ModeManager::AddUserMode(new UserMode("REGISTERED", 'R')); + ModeManager::AddUserMode(new UserMode("SNOMASK", 's')); + ModeManager::AddUserMode(new UserMode("WALLOPS", 'w')); + ModeManager::AddUserMode(new UserMode("CLOAK", 'x')); /* Add modes for ban, exception, and invite lists */ - ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b')); - ModeManager::AddChannelMode(new ChannelModeList(CMODE_EXCEPT, 'e')); - ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I')); + ModeManager::AddChannelMode(new ChannelModeList("BAN", 'b')); + ModeManager::AddChannelMode(new ChannelModeList("EXCEPT", 'e')); + ModeManager::AddChannelMode(new ChannelModeList("INVITEOVERRIDE", 'I')); /* Add channel user modes */ - ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_VOICE, 'v', '+')); - ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_HALFOP, 'h', '%')); - ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_OP, 'o', '@')); - ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_PROTECT, 'a', '&')); - ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_OWNER, 'q','~')); + ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+')); + ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%')); + ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@')); + ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '&')); + ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q','~')); /* Add channel modes */ - ModeManager::AddChannelMode(new ChannelMode(CMODE_INVITE, 'i')); + ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i')); ModeManager::AddChannelMode(new ChannelModeKey('k')); - ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_MODERATED, 'm')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_REGMODERATED, 'M')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_NOEXTERNAL, 'n')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_OPERONLY, 'O')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_PERM, 'P')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_NOKICK, 'Q')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm')); + ModeManager::AddChannelMode(new ChannelMode("REGMODERATED", 'M')); + ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n')); + ModeManager::AddChannelMode(new ChannelMode("OPERONLY", 'O')); + ModeManager::AddChannelMode(new ChannelMode("PERM", 'P')); + ModeManager::AddChannelMode(new ChannelMode("NOKICK", 'Q')); ModeManager::AddChannelMode(new ChannelModeRegistered('r')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_REGISTEREDONLY, 'R')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_SECRET, 's')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_TOPIC, 't')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_NOINVITE, 'V')); - ModeManager::AddChannelMode(new ChannelMode(CMODE_SSL, 'z')); + ModeManager::AddChannelMode(new ChannelMode("REGISTEREDONLY", 'R')); + ModeManager::AddChannelMode(new ChannelMode("SECRET", 's')); + ModeManager::AddChannelMode(new ChannelMode("TOPIC", 't')); + ModeManager::AddChannelMode(new ChannelMode("NOINVITE", 'V')); + ModeManager::AddChannelMode(new ChannelMode("SSL", 'z')); } public: @@ -681,7 +681,7 @@ class ProtongIRCd : public Module void OnUserNickChange(User *u, const Anope::string &) anope_override { - u->RemoveModeInternal(ModeManager::FindUserModeByName(UMODE_REGISTERED)); + u->RemoveModeInternal(ModeManager::FindUserModeByName("REGISTERED")); } }; |