diff options
| author | Adam <Adam@anope.org> | 2010-11-20 21:45:30 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-12-12 19:35:27 -0500 |
| commit | 246f44b9888161aecefc81f0ff17ddd893287e3c (patch) | |
| tree | b89607a9ad9c91914f292fc54cc32213a8d9f5c4 /modules/protocol | |
| parent | a85112172d842aa74aa5531788d383328d153e74 (diff) | |
Added cs_mode, rewrote the old list mode code, and added CIDR support
Diffstat (limited to 'modules/protocol')
| -rw-r--r-- | modules/protocol/bahamut.cpp | 1 | ||||
| -rw-r--r-- | modules/protocol/inspircd11.cpp | 1 | ||||
| -rw-r--r-- | modules/protocol/inspircd12.cpp | 1 | ||||
| -rw-r--r-- | modules/protocol/inspircd20.cpp | 1 | ||||
| -rw-r--r-- | modules/protocol/ratbox.cpp | 25 | ||||
| -rw-r--r-- | modules/protocol/unreal32.cpp | 25 |
6 files changed, 18 insertions, 36 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 70dffb8ce..e2a5b2af7 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -37,7 +37,6 @@ IRCDVar myIrcd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 0, /* ts6 */ - 0, /* CIDR channelbans */ "$", /* TLD Prefix for Global */ 6, /* Max number of modes we can send per line */ } diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 7d1d456ac..f7a13ad7a 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -38,7 +38,6 @@ IRCDVar myIrcd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 0, /* ts6 */ - 1, /* CIDR channelbans */ "$", /* TLD Prefix for Global */ 20, /* Max number of modes we can send per line */ } diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index c4c5fa558..196c748cf 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -38,7 +38,6 @@ IRCDVar myIrcd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 1, /* ts6 */ - 1, /* CIDR channelbans */ "$", /* TLD Prefix for Global */ 20, /* Max number of modes we can send per line */ } diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index ea696c15a..848590b2d 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -38,7 +38,6 @@ IRCDVar myIrcd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 1, /* ts6 */ - 1, /* CIDR channelbans */ "$", /* TLD Prefix for Global */ 20, /* Max number of modes we can send per line */ } diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 9b5f02e46..0e034aa00 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -37,7 +37,6 @@ IRCDVar myIrcd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 1, /* ts6 */ - 0, /* CIDR channelbans */ "$$", /* TLD Prefix for Global */ 4, /* Max number of modes we can send per line */ } @@ -626,26 +625,20 @@ bool event_bmask(const Anope::string &source, const std::vector<Anope::string> & if (c) { + ChannelMode *ban = ModeManager::FindChannelModeByName(CMODE_BAN), + *except = ModeManager::FindChannelModeByName(CMODE_EXCEPT), + *invex = ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE); Anope::string bans = params[3]; int count = myNumToken(bans, ' '), i; for (i = 0; i <= count - 1; ++i) { Anope::string b = myStrGetToken(bans, ' ', i); - if (params[2].equals_cs("b")) - { - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('b')); - cml->AddMask(c, b); - } - else if (params[2].equals_cs("e")) - { - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('e')); - cml->AddMask(c, b); - } - if (params[2].equals_cs("I")) - { - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('I')); - cml->AddMask(c, b); - } + if (ban && params[2].equals_cs("b")) + c->SetModeInternal(ban, b); + else if (except && params[2].equals_cs("e")) + c->SetModeInternal(except, b); + if (invex && params[2].equals_cs("I")) + c->SetModeInternal(invex, b); } } return true; diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp index 074bd5f62..70e03cf55 100644 --- a/modules/protocol/unreal32.cpp +++ b/modules/protocol/unreal32.cpp @@ -37,7 +37,6 @@ IRCDVar myIrcd[] = { 1, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ 0, /* ts6 */ - 0, /* CIDR channelbans */ "$", /* TLD Prefix for Global */ 12, /* Max number of modes we can send per line */ } @@ -986,36 +985,30 @@ bool event_sjoin(const Anope::string &source, const std::vector<Anope::string> & c->SetModesInternal(NULL, modes); } + ChannelMode *ban = ModeManager::FindChannelModeByName(CMODE_BAN), + *except = ModeManager::FindChannelModeByName(CMODE_EXCEPT), + *invex = ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE); spacesepstream sep(params[params.size() - 1]); Anope::string buf; while (sep.GetToken(buf)) { /* Ban */ - if (keep_their_modes && buf[0] == '&') + if (keep_their_modes && ban && buf[0] == '&') { buf.erase(buf.begin()); - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_BAN)); - - if (cml->IsValid(buf)) - cml->AddMask(c, buf); + c->SetModeInternal(ban, buf); } /* Except */ - else if (keep_their_modes && buf[0] == '"') + else if (keep_their_modes && except && buf[0] == '"') { buf.erase(buf.begin()); - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_EXCEPT)); - - if (cml->IsValid(buf)) - cml->AddMask(c, buf); + c->SetModeInternal(except, buf); } /* Invex */ - else if (keep_their_modes && buf[0] == '\'') + else if (keep_their_modes && invex && buf[0] == '\'') { buf.erase(buf.begin()); - ChannelModeList *cml = debug_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE)); - - if (cml->IsValid(buf)) - cml->AddMask(c, buf); + c->SetModeInternal(invex, buf); } else { |
