summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-02-06 19:27:10 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-02-06 19:27:10 +0000
commit87b62c433d3abdf92b8d55987f76553d9422c3d2 (patch)
treeeccd3a0cc240a747029a85ed0c47456ccbc60da9 /src
parentde99f898941afa524bde2ac2442b54a673750c5f (diff)
Remove protectbotserv option from modes, just use options:botmodes instead
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2782 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c12
-rw-r--r--src/modes.cpp4
-rw-r--r--src/protocol/bahamut.c2
-rw-r--r--src/protocol/inspircd11.c4
-rw-r--r--src/protocol/inspircd12.cpp4
-rw-r--r--src/protocol/ratbox.c2
-rw-r--r--src/protocol/unreal32.c4
7 files changed, 19 insertions, 13 deletions
diff --git a/src/channels.c b/src/channels.c
index 4f764b8fc..69843d1da 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -445,9 +445,17 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string &param, bool
return;
}
- /* We don't track bots */
- if (findbot(param))
+ /* Reset modes on bots if we're supposed to */
+ BotInfo *bi = findbot(param);
+ if (bi)
+ {
+ if (std::find(BotModes.begin(), BotModes.end(), cm) != BotModes.end())
+ {
+ this->SetMode(bi, cm, bi->nick);
+ }
+ /* We don't track bots */
return;
+ }
User *u = finduser(param);
if (!u)
diff --git a/src/modes.cpp b/src/modes.cpp
index 466d7900c..0c259ea7c 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -162,13 +162,11 @@ ChannelModeParam::~ChannelModeParam()
/** Default constructor
* @param mName The mode name
* @param mSymbol The symbol for the mode, eg @ % +
- * @param mProtectBotServ Should botserv clients reset this on themself if it gets unset?
*/
-ChannelModeStatus::ChannelModeStatus(ChannelModeName mName, char mSymbol, bool mProtectBotServ) : ChannelMode(mName)
+ChannelModeStatus::ChannelModeStatus(ChannelModeName mName, char mSymbol) : ChannelMode(mName)
{
this->Type = MODE_STATUS;
this->Symbol = mSymbol;
- this->ProtectBotServ = mProtectBotServ;
}
/** Default destructor
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index d045649a1..d9c32892c 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -821,7 +821,7 @@ void moduleAddModes()
/* v/h/o/a/q */
ModeManager::AddChannelMode('v', new ChannelModeStatus(CMODE_VOICE, '+'));
- ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@', true));
+ ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@'));
/* Add channel modes */
ModeManager::AddChannelMode('c', new ChannelMode(CMODE_BLOCKCOLOR));
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index d86286562..551233b00 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -1065,10 +1065,10 @@ int anope_event_capab(const char *source, int ac, const char **av)
ModeManager::AddChannelMode('q', new ChannelModeStatus(CMODE_OWNER, '~'));
continue;
case 'a':
- ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, '&', true));
+ ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, '&'));
continue;
case 'o':
- ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@', true));
+ ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@'));
continue;
case 'h':
ModeManager::AddChannelMode('h', new ChannelModeStatus(CMODE_HALFOP, '%'));
diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp
index a767d5a06..3c5f4202c 100644
--- a/src/protocol/inspircd12.cpp
+++ b/src/protocol/inspircd12.cpp
@@ -1252,10 +1252,10 @@ int anope_event_capab(const char *source, int ac, const char **av)
ModeManager::AddChannelMode('q', new ChannelModeStatus(CMODE_OWNER, chars[t]));
continue;
case 'a':
- ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, chars[t], true));
+ ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, chars[t]));
continue;
case 'o':
- ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, chars[t], true));
+ ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, chars[t]));
continue;
case 'h':
ModeManager::AddChannelMode('h', new ChannelModeStatus(CMODE_HALFOP, chars[t]));
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index b5c7f66a7..2564a99f3 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -895,7 +895,7 @@ void moduleAddModes()
/* v/h/o/a/q */
ModeManager::AddChannelMode('v', new ChannelModeStatus(CMODE_VOICE, '+'));
- ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@', true));
+ ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@'));
/* Add channel modes */
ModeManager::AddChannelMode('i', new ChannelMode(CMODE_INVITE));
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index 427500b98..71e2d09c4 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -1354,8 +1354,8 @@ static void AddModes()
{
ModeManager::AddChannelMode('v', new ChannelModeStatus(CMODE_VOICE, '+'));
ModeManager::AddChannelMode('h', new ChannelModeStatus(CMODE_HALFOP, '%'));
- ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@', true));
- ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, '&', true));
+ ModeManager::AddChannelMode('o', new ChannelModeStatus(CMODE_OP, '@'));
+ ModeManager::AddChannelMode('a', new ChannelModeStatus(CMODE_PROTECT, '&'));
/* Unreal sends +q as * */
ModeManager::AddChannelMode('q', new ChannelModeStatus(CMODE_OWNER, '*'));