diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modes.cpp | 12 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 9 | ||||
-rw-r--r-- | src/protocol/inspircd12.cpp | 10 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 8 |
4 files changed, 39 insertions, 0 deletions
diff --git a/src/modes.cpp b/src/modes.cpp index fa3a3fc1b..b1cf23ed2 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -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); diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 59f7710a7..a7335daf7 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -920,6 +920,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'I': ModeManager::AddChannelMode(new ChannelModeInvite('I')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeList(CMODE_END, modebuf[t])); } } @@ -931,6 +933,9 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'k': ModeManager::AddChannelMode(new ChannelModeKey('k')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t])); + } } @@ -948,6 +953,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'L': ModeManager::AddChannelMode(new ChannelModeParam(CMODE_REDIRECT, 'L', true)); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t], true)); } } @@ -1016,6 +1023,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'V': ModeManager::AddChannelMode(new ChannelMode(CMODE_NOINVITE, 'V')); continue; + default: + ModeManager::AddChannelMode(new ChannelMode(CMODE_END, modebuf[t])); } } } diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 98d993eec..ae78b1ee7 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -1011,6 +1011,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'I': ModeManager::AddChannelMode(new ChannelModeInvite('I')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeList(CMODE_END, modebuf[t])); } } @@ -1022,6 +1024,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'k': ModeManager::AddChannelMode(new ChannelModeKey('k')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t])); } } @@ -1048,6 +1052,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'l': ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l', true)); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t], true)); } } @@ -1125,6 +1131,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'z': ModeManager::AddChannelMode(new ChannelMode(CMODE_SSL, 'z')); continue; + default: + ModeManager::AddChannelMode(new ChannelMode(CMODE_END, modebuf[t])); } } } @@ -1194,6 +1202,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'd': ModeManager::AddUserMode(new UserMode(UMODE_DEAF, 'd')); continue; + default: + ModeManager::AddUserMode(new UserMode(UMODE_END, modebuf[t])); } } } diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 35ced626c..1e22c109f 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -465,6 +465,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'I': ModeManager::AddChannelMode(new ChannelModeInvite('I')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeList(CMODE_END, modebuf[t])); } } @@ -482,6 +484,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'L': ModeManager::AddChannelMode(new ChannelModeParam(CMODE_REDIRECT, 'L')); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t])); } } @@ -496,6 +500,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'j': ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, 'j', true)); continue; + default: + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_END, modebuf[t], true)); } } @@ -570,6 +576,8 @@ int anope_event_capab(const char *source, int ac, const char **av) case 'G': ModeManager::AddChannelMode(new ChannelMode(CMODE_FILTER, 'G')); continue; + default: + ModeManager::AddChannelMode(new ChannelMode(CMODE_END, modebuf[t])); } } } |