1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 15:26:38 +02:00

Added generic support for unknown modes told to Anope at runtime by the IRCd

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2790 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2010-02-12 19:51:16 +00:00
parent 2eb2cb7650
commit 84ecd1866c
5 changed files with 41 additions and 0 deletions
+12
View File
@@ -28,6 +28,8 @@ std::map<ChannelModeName, ChannelMode *> ModeManager::ChannelModesByName;
/* List of all modes Anope knows about */
std::list<Mode *> ModeManager::Modes;
/* Number of generic modes we support */
unsigned GenericChannelModes = 0, GenericUserModes = 0;
/* Default mlocked modes on */
std::bitset<128> DefMLockOn;
/* Default mlocked modes off */
@@ -617,6 +619,11 @@ bool ModeManager::AddUserMode(UserMode *um)
{
if (ModeManager::UserModesByChar.insert(std::make_pair(um->ModeChar, um)).second)
{
if (um->Name == UMODE_END)
{
um->Name = static_cast<UserModeName>(UMODE_END + ++GenericUserModes);
Alog() << "ModeManager: Added generic support for user mode " << um->ModeChar;
}
ModeManager::UserModesByName.insert(std::make_pair(um->Name, um)).second;
ModeManager::Modes.push_back(um);
@@ -636,6 +643,11 @@ bool ModeManager::AddChannelMode(ChannelMode *cm)
{
if (ModeManager::ChannelModesByChar.insert(std::make_pair(cm->ModeChar, cm)).second)
{
if (cm->Name == CMODE_END)
{
cm->Name = static_cast<ChannelModeName>(CMODE_END + ++GenericChannelModes);
Alog() << "ModeManager: Added generic support for channel mode " << cm->ModeChar;
}
ModeManager::ChannelModesByName.insert(std::make_pair(cm->Name, cm)).second;
ModeManager::Modes.push_back(cm);