mirror of
https://github.com/anope/anope.git
synced 2026-06-26 09:56:38 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user