diff options
author | Adam <Adam@anope.org> | 2011-03-07 19:54:51 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-03-07 19:54:51 -0500 |
commit | 8eb23e7d489239e8af79c2d6da587cd1c3a81b5d (patch) | |
tree | 04bf54ceb46a4b18345cf4e01d8aeb11ccd52c07 /modules/protocol/inspircd11.cpp | |
parent | 093b3d258e7b14d2aa057ca6113de034b5063efe (diff) |
Added support for extbans
Diffstat (limited to 'modules/protocol/inspircd11.cpp')
-rw-r--r-- | modules/protocol/inspircd11.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 9d72eef6c..e903bb2a3 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -264,6 +264,25 @@ class InspIRCdProto : public IRCDProto }; +class ChannelModeFlood : public ChannelModeParam +{ + public: + ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam(CMODE_FLOOD, modeChar, minusNoArg) { } + + bool IsValid(const Anope::string &value) const + { + try + { + Anope::string rest; + if (!value.empty() && value[0] != ':' && convertTo<int>(value[0] == '*' ? value.substr(1) : value, rest, false) > 0 && rest[0] == ':' && rest.length() > 1 && convertTo<int>(rest.substr(1), rest, false) > 0 && rest.empty()) + return true; + } + catch (const ConvertException &) { } + + return false; + } +}; + class InspircdIRCdMessage : public IRCdMessage { public: @@ -374,13 +393,13 @@ class InspircdIRCdMessage : public IRCdMessage switch (modebuf[t]) { case 'b': - ModeManager::AddChannelMode(new ChannelModeBan('b')); + ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b')); continue; case 'e': - ModeManager::AddChannelMode(new ChannelModeExcept('e')); + ModeManager::AddChannelMode(new ChannelModeList(CMODE_EXCEPT, 'e')); continue; case 'I': - ModeManager::AddChannelMode(new ChannelModeInvex('I')); + ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I')); continue; default: ModeManager::AddChannelMode(new ChannelModeList(CMODE_END, modebuf[t])); @@ -406,7 +425,7 @@ class InspircdIRCdMessage : public IRCdMessage switch (modebuf[t]) { case 'f': - ModeManager::AddChannelMode(new ChannelModeFlood('f')); + ModeManager::AddChannelMode(new ChannelModeFlood('f', false)); continue; case 'l': ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l', true)); @@ -844,19 +863,6 @@ bool event_endburst(const Anope::string &source, const std::vector<Anope::string return true; } -bool ChannelModeFlood::IsValid(const Anope::string &value) const -{ - try - { - Anope::string rest; - if (!value.empty() && value[0] != ':' && convertTo<int>(value[0] == '*' ? value.substr(1) : value, rest, false) > 0 && rest[0] == ':' && rest.length() > 1 && convertTo<int>(rest.substr(1), rest, false) > 0 && rest.empty()) - return true; - } - catch (const ConvertException &) { } - - return false; -} - class ProtoInspIRCd : public Module { Message message_endburst, message_rsquit, message_svsmode, message_chghost, message_chgident, message_chgname, |