#include <modes.h>

Static Public Member Functions | |
| static bool | AddUserMode (UserMode *um) |
| static bool | AddChannelMode (ChannelMode *cm) |
| static void | RemoveUserMode (UserMode *um) |
| static void | RemoveChannelMode (ChannelMode *cm) |
| static ChannelMode * | FindChannelModeByChar (char mode) |
| static UserMode * | FindUserModeByChar (char mode) |
| static ChannelMode * | FindChannelModeByName (const Anope::string &name) |
| static UserMode * | FindUserModeByName (const Anope::string &name) |
| static char | GetStatusChar (char symbol) |
| static void | StackerAdd (const BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string ¶m="") |
| static void | StackerAdd (const BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string ¶m="") |
| static void | ProcessModes () |
| static void | StackerDel (User *u) |
| static void | StackerDel (Channel *c) |
| static void | StackerDel (Mode *m) |
| static void | UpdateDefaultMLock (ServerConfig *config) |
Static Public Attributes | |
| static std::vector< ChannelMode * > | ChannelModes |
| static std::vector< UserMode * > | UserModes |
| static unsigned | GenericChannelModes = 0 |
| static unsigned | GenericUserModes = 0 |
| static std::list< std::pair < Anope::string, Anope::string > > | ModeLockOn |
| static std::list< Anope::string > | ModeLockOff |
| static ChannelStatus | DefaultBotModes |
Static Protected Member Functions | |
| static std::list< Anope::string > | BuildModeStrings (StackerInfo *info) |
Static Protected Attributes | |
| static std::map< User *, StackerInfo * > | UserStackerObjects |
| static std::map< Channel *, StackerInfo * > | ChannelStackerObjects |
This is the mode manager It contains functions for adding modes to Anope so Anope can track them and do things such as MLOCK. This also contains a mode stacker that will combine multiple modes and set them on a channel or user at once
Definition at line 282 of file modes.h.
| bool ModeManager::AddChannelMode | ( | ChannelMode * | cm | ) | [static] |
Add a channel mode to Anope
| cm | A ChannelMode or ChannelMode derived class |
Definition at line 306 of file modes.cpp.
References ChannelModes, Config, Anope::string::empty(), FindChannelModeByChar(), FOREACH_MOD, GenericChannelModes, I_OnChannelModeAdd, Mode::mchar, Mode::name, stringify(), and UpdateDefaultMLock().
Referenced by ProtoUnreal::AddModes(), ProtoPlexus::AddModes(), ProtongIRCd::AddModes(), ProtoHybrid::AddModes(), ProtoBahamut::AddModes(), and IRCDMessageCapab::Run().
| bool ModeManager::AddUserMode | ( | UserMode * | um | ) | [static] |
Add a user mode to Anope
Definition at line 288 of file modes.cpp.
References Anope::string::empty(), FindUserModeByChar(), FOREACH_MOD, GenericUserModes, I_OnUserModeAdd, Mode::mchar, Mode::name, stringify(), and UserModes.
Referenced by ProtoUnreal::AddModes(), ProtoPlexus::AddModes(), ProtongIRCd::AddModes(), ProtoInspIRCd::AddModes(), ProtoHybrid::AddModes(), ProtoBahamut::AddModes(), and IRCDMessageCapab::Run().
| std::list< Anope::string > ModeManager::BuildModeStrings | ( | StackerInfo * | info | ) | [static, protected] |
Build a list of mode strings to send to the IRCd from the mode stacker
| info | The stacker info for a channel or user |
Definition at line 236 of file modes.cpp.
References StackerInfo::AddModes, Anope::string::clear(), StackerInfo::DelModes, Anope::string::empty(), Anope::string::erase(), IRCD, Anope::string::length(), IRCDProto::MaxModes, and Anope::string::push_back().
Referenced by ProcessModes().
| ChannelMode * ModeManager::FindChannelModeByChar | ( | char | mode | ) | [static] |
Find a channel mode
| mode | The mode |
Definition at line 357 of file modes.cpp.
References ChannelModes, and Mode::mchar.
Referenced by AddChannelMode(), CommandCSMode::DoLock(), DoServices(), CommandCSMode::DoSet(), CommandOSMode::Execute(), UnrealExtBan::Matches(), InspIRCdExtBan::Matches(), OSDefcon::ParseModeString(), process_mlock(), IRCDMessageNJoin::Run(), IRCDMessageCapab::Run(), IRCDMessageFJoin::Run(), IRCDMessageSJoin::Run(), Server::Server(), Channel::SetModes(), Channel::SetModesInternal(), and UpdateDefaultMLock().
| ChannelMode * ModeManager::FindChannelModeByName | ( | const Anope::string & | name | ) | [static] |
Find a channel mode
| name | The modename |
Definition at line 381 of file modes.cpp.
References ChannelModes, and Mode::name.
Referenced by ProtoRatbox::AddModes(), ProtoPlexus::AddModes(), CommandCSMode::CanSet(), Channel::CheckModes(), CommandCSMode::DoClear(), CommandCSMode::DoLock(), CommandCSSetPersist::Execute(), CommandCSRegister::Execute(), CommandCSClone::Execute(), CommandBSUnassign::Execute(), ChannelInfo::GetMLockAsString(), Channel::GetModes(), Channel::HasUserStatus(), Entry::Matches(), OSDefcon::OnChannelModeSet(), OSDefcon::OnChannelModeUnset(), NSRecover::OnJoinChannel(), ProtoUnreal::OnMLock(), ProtoInspIRCd::OnMLock(), DBPlain::OnSaveDatabase(), ProtoUnreal::OnUnMLock(), ProtoInspIRCd::OnUnMLock(), OSDefcon::ParseModeString(), Channel::RemoveMode(), IRCDMessageSJoin::Run(), IRCDMessageBMask::Run(), Channel::SetCorrectModes(), Channel::SetMode(), and Server::Sync().
| UserMode * ModeManager::FindUserModeByChar | ( | char | mode | ) | [static] |
Find a user mode
| mode | The mode |
Definition at line 369 of file modes.cpp.
References Mode::mchar, and UserModes.
Referenced by AddUserMode(), User::SetModes(), and User::SetModesInternal().
| UserMode * ModeManager::FindUserModeByName | ( | const Anope::string & | name | ) | [static] |
Find a user mode
| name | The modename |
Definition at line 393 of file modes.cpp.
References Mode::name, and UserModes.
Referenced by ProtoRatbox::AddModes(), ProtoPlexus::AddModes(), User::GetModes(), User::Identify(), ProtoUnreal::OnUserNickChange(), ProtongIRCd::OnUserNickChange(), ProtoInspIRCd::OnUserNickChange(), ProtoHybrid::OnUserNickChange(), ProtoBahamut::OnUserNickChange(), User::RemoveMode(), IRCDMessageCapab::Run(), and User::SetMode().
| char ModeManager::GetStatusChar | ( | char | symbol | ) | [static] |
Gets the channel mode char for a symbol (eg + returns v)
| symbol | The symbol |
Definition at line 405 of file modes.cpp.
References anope_dynamic_static_cast(), ChannelModes, Mode::mchar, MODE_STATUS, ChannelModeStatus::Symbol, and Mode::type.
Referenced by DoServices(), CommandCSLog::Execute(), UnrealExtBan::Matches(), InspIRCdExtBan::Matches(), IRCDMessageNJoin::Run(), IRCDMessageFJoin::Run(), IRCDMessageSJoin::Run(), and Server::Server().
| void ModeManager::ProcessModes | ( | ) | [static] |
Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
Definition at line 450 of file modes.cpp.
References StackerInfo::bi, BuildModeStrings(), ChannelStackerObjects, IRCD, IRCDProto::SendMode(), and UserStackerObjects.
Referenced by BotInfo::Join(), ModePipe::OnNotify(), ngIRCdProto::SendVhost(), and UnrealIRCdProto::SendVhostDel().
| void ModeManager::RemoveChannelMode | ( | ChannelMode * | cm | ) | [static] |
Remove a channel mode from Anope
| um | A ChanneMode to remove |
Definition at line 342 of file modes.cpp.
References ChannelModes, and StackerDel().
Referenced by ProtoRatbox::AddModes(), and ProtoPlexus::AddModes().
| void ModeManager::RemoveUserMode | ( | UserMode * | um | ) | [static] |
Remove a user mode from Anope
| um | A UserMode to remove |
Definition at line 327 of file modes.cpp.
References StackerDel(), and UserModes.
Referenced by ProtoRatbox::AddModes(), and ProtoPlexus::AddModes().
| void ModeManager::StackerAdd | ( | const BotInfo * | bi, | |
| Channel * | c, | |||
| ChannelMode * | cm, | |||
| bool | set, | |||
| const Anope::string & | param = "" | |||
| ) | [static] |
Add a mode to the stacker to be set on a channel
| bi | The client to set the modes from | |
| c | The channel | |
| cm | The channel mode | |
| set | true for setting, false for removing | |
| param | The param, if there is one |
Definition at line 422 of file modes.cpp.
References StackerInfo::AddMode(), StackerInfo::bi, ChannelStackerObjects, Channel::ci, GetInfo(), modePipe, and Pipe::Notify().
Referenced by User::RemoveMode(), Channel::RemoveMode(), User::SetMode(), and Channel::SetMode().
| void ModeManager::StackerAdd | ( | const BotInfo * | bi, | |
| User * | u, | |||
| UserMode * | um, | |||
| bool | set, | |||
| const Anope::string & | param = "" | |||
| ) | [static] |
Add a mode to the stacker to be set on a user
| bi | The client to set the modes from | |
| u | The user | |
| um | The user mode | |
| set | true for setting, false for removing | |
| param | The param, if there is one |
Definition at line 436 of file modes.cpp.
References StackerInfo::AddMode(), StackerInfo::bi, GetInfo(), modePipe, Pipe::Notify(), and UserStackerObjects.
| void ModeManager::StackerDel | ( | User * | u | ) | [static] |
Delete a user, channel, or mode from the stacker
Definition at line 483 of file modes.cpp.
References UserStackerObjects.
Referenced by RemoveChannelMode(), RemoveUserMode(), Channel::~Channel(), and User::~User().
| void ModeManager::StackerDel | ( | Mode * | m | ) | [static] |
Definition at line 493 of file modes.cpp.
References StackerInfo::AddModes, ChannelStackerObjects, StackerInfo::DelModes, and UserStackerObjects.
| void ModeManager::StackerDel | ( | Channel * | c | ) | [static] |
Definition at line 488 of file modes.cpp.
References ChannelStackerObjects.
| void ModeManager::UpdateDefaultMLock | ( | ServerConfig * | config | ) | [static] |
Updates the default mode locks and default bot modes
| config | The configuration to read from. This is often called during a config reload. |
Definition at line 540 of file modes.cpp.
References ServerConfig::BotModes, DefaultBotModes, FindChannelModeByChar(), sepstream::GetToken(), Anope::string::length(), Mode::mchar, ServerConfig::MLock, MODE_LIST, MODE_REGULAR, MODE_STATUS, ModeLockOff, ModeLockOn, ChannelStatus::modes, Mode::name, and Mode::type.
Referenced by AddChannelMode(), and ServerConfig::ServerConfig().
std::vector< ChannelMode * > ModeManager::ChannelModes [static] |
Definition at line 297 of file modes.h.
Referenced by AddChannelMode(), ChannelStatus::BuildCharPrefixList(), ChannelStatus::BuildModePrefixList(), DoServices(), CommandCSMode::DoSet(), FindChannelModeByChar(), FindChannelModeByName(), GetStatusChar(), CommandCSDown::RemoveAll(), RemoveChannelMode(), Channel::Reset(), UnrealIRCdProto::SendJoin(), PlexusProto::SendJoin(), ngIRCdProto::SendJoin(), InspIRCd12Proto::SendJoin(), InspIRCdProto::SendJoin(), and BahamutIRCdProto::SendJoin().
std::map< Channel *, StackerInfo * > ModeManager::ChannelStackerObjects [static, protected] |
Definition at line 287 of file modes.h.
Referenced by ProcessModes(), StackerAdd(), and StackerDel().
Definition at line 307 of file modes.h.
Referenced by BotInfo::Assign(), CommandCSClone::Execute(), Channel::KickInternal(), BotServCore::OnJoinChannel(), Channel::RemoveModeInternal(), and UpdateDefaultMLock().
unsigned ModeManager::GenericChannelModes = 0 [static] |
Definition at line 301 of file modes.h.
Referenced by AddChannelMode().
unsigned ModeManager::GenericUserModes = 0 [static] |
Definition at line 302 of file modes.h.
Referenced by AddUserMode().
std::list< Anope::string > ModeManager::ModeLockOff [static] |
Definition at line 305 of file modes.h.
Referenced by CommandCSRegister::Execute(), and UpdateDefaultMLock().
std::list< std::pair< Anope::string, Anope::string > > ModeManager::ModeLockOn [static] |
Definition at line 304 of file modes.h.
Referenced by CommandCSRegister::Execute(), and UpdateDefaultMLock().
std::vector< UserMode * > ModeManager::UserModes [static] |
Definition at line 298 of file modes.h.
Referenced by AddUserMode(), FindUserModeByChar(), FindUserModeByName(), and RemoveUserMode().
std::map< User *, StackerInfo * > ModeManager::UserStackerObjects [static, protected] |
Definition at line 286 of file modes.h.
Referenced by ProcessModes(), StackerAdd(), and StackerDel().
1.7.1