mirror of
https://github.com/anope/anope.git
synced 2026-07-06 14:13:13 +02:00
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
This commit is contained in:
+38
-38
@@ -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"));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user