diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-02 03:20:58 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-02 03:20:58 +0000 |
commit | 122dcd082ae1ad01e953d0488f9fc41a4e0566a3 (patch) | |
tree | 2aaf07248f4307cd58a123dbd63cab8ae72031c7 /src/modes.cpp | |
parent | aa4b3e256377030d291fc2d5f4db94985ce04395 (diff) |
Added options:botmodes to configure what modes BotServ bots should use in channels
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2778 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modes.cpp')
-rw-r--r-- | src/modes.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/modes.cpp b/src/modes.cpp index dfee2b214..466d7900c 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -15,6 +15,7 @@ /* List of pairs of user/channels and their stacker info */ std::list<std::pair<void *, StackerInfo *> > ModeManager::StackerObjects; +/* User modes */ std::map<char, UserMode *> ModeManager::UserModesByChar; std::map<UserModeName, UserMode *> ModeManager::UserModesByName; /* Channel modes */ @@ -31,6 +32,8 @@ std::bitset<128> DefMLockOn; std::bitset<128> DefMLockOff; /* Map for default mlocked mode parameters */ std::map<ChannelModeName, std::string> DefMLockParams; +/* Modes to set on bots when they join the channel */ +std::list<ChannelModeStatus *> BotModes; /** Parse the mode string from the config file and set the default mlocked modes */ @@ -77,6 +80,18 @@ void SetDefaultMLock() } } } + + /* Set Bot Modes */ + BotModes.clear(); + for (unsigned i = 0; i < Config.BotModes.size(); ++i) + { + ChannelMode *cm = ModeManager::FindChannelModeByChar(Config.BotModes[i]); + + if (cm && cm->Type == MODE_STATUS && std::find(BotModes.begin(), BotModes.end(), cm) == BotModes.end()) + { + BotModes.push_back(dynamic_cast<ChannelModeStatus *>(cm)); + } + } } /** Default constructor |