Anope IRC Services  Version 2.0
Static Public Member Functions | Static Public Attributes
ModeManager Class Reference

#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 ChannelModeFindChannelModeByChar (char mode)
static UserModeFindUserModeByChar (char mode)
static ChannelModeFindChannelModeByName (const Anope::string &name)
static UserModeFindUserModeByName (const Anope::string &name)
static char GetStatusChar (char symbol)
static const std::vector
< ChannelMode * > & 
GetChannelModes ()
static const std::vector
< UserMode * > & 
GetUserModes ()
static const std::vector
< ChannelModeStatus * > & 
GetStatusChannelModesByRank ()
static void RebuildStatusModes ()
static void StackerAdd (BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string &param="")
static void StackerAdd (BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string &param="")
static void ProcessModes ()
static void StackerDel (User *u)
static void StackerDel (Channel *c)
static void StackerDel (Mode *m)

Static Public Attributes

static unsigned GenericChannelModes = 0
static unsigned GenericUserModes = 0

Detailed Description

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 292 of file modes.h.

Member Function Documentation

bool ModeManager::AddChannelMode ( ChannelMode cm)
bool ModeManager::AddUserMode ( UserMode um)
ChannelMode * ModeManager::FindChannelModeByChar ( char  mode)
ChannelMode * ModeManager::FindChannelModeByName ( const Anope::string name)
UserMode * ModeManager::FindUserModeByChar ( char  mode)

Find a user mode

modeThe mode
The mode class

Definition at line 533 of file modes.cpp.

References UserModesIdx.

Referenced by AddUserMode(), User::SetModes(), and User::SetModesInternal().

UserMode * ModeManager::FindUserModeByName ( const Anope::string name)
const std::vector< ChannelMode * > & ModeManager::GetChannelModes ( )

Definition at line 571 of file modes.cpp.

References ChannelModes.

Referenced by CommandCSMode::DoSet(), and WebCPanel::ChanServ::Modes::OnRequest().

const std::vector< ChannelModeStatus * > & ModeManager::GetStatusChannelModesByRank ( )
char ModeManager::GetStatusChar ( char  symbol)

Gets the channel mode char for a symbol (eg + returns v)

symbolThe symbol
The char

Definition at line 558 of file modes.cpp.

References ChannelModesIdx, Mode::mchar, MODE_STATUS, and Mode::type.

Referenced by Configuration::Conf::Conf(), CommandCSLog::Execute(), InspIRCdExtban::ChannelMatcher::Matches(), UnrealExtban::ChannelMatcher::Matches(), IRCDMessageSJoin::Run(), IRCDMessageNJoin::Run(), and Server::Server().

const std::vector< UserMode * > & ModeManager::GetUserModes ( )

Definition at line 576 of file modes.cpp.

References UserModes.

void ModeManager::ProcessModes ( )

Process all of the modes in the stacker and send them to the IRCd to be set on channels/users

Definition at line 633 of file modes.cpp.

References StackerInfo::bi, BuildModeStrings(), ChannelStackerObjects, IRCD, IRCDProto::SendMode(), and UserStackerObjects.

Referenced by BotServCore::OnJoinChannel(), ModePipe::OnNotify(), NSAJoin::OnUserLogin(), ngIRCdProto::SendVhost(), and UnrealIRCdProto::SendVhostDel().

void ModeManager::RebuildStatusModes ( )
void ModeManager::RemoveChannelMode ( ChannelMode cm)

Remove a channel mode from Anope

umA ChanneMode to remove

Definition at line 482 of file modes.cpp.

References anope_dynamic_static_cast(), ChannelModes, ChannelModesByName, ChannelModesIdx, Mode::mchar, MODE_STATUS, Mode::name, RebuildStatusModes(), StackerDel(), ChannelModeStatus::symbol, and Mode::type.

void ModeManager::RemoveUserMode ( UserMode um)

Remove a user mode from Anope

umA UserMode to remove

Definition at line 459 of file modes.cpp.

References Mode::mchar, Mode::name, StackerDel(), UserModes, UserModesByName, and UserModesIdx.

void ModeManager::StackerAdd ( BotInfo bi,
Channel c,
ChannelMode cm,
bool  set,
const Anope::string param = "" 

Add a mode to the stacker to be set on a channel

biThe client to set the modes from
cThe channel
cmThe channel mode
settrue for setting, false for removing
paramThe param, if there is one

Definition at line 607 of file modes.cpp.

References StackerInfo::AddMode(), StackerInfo::bi, ChannelStackerObjects, Channel::ci, GetInfo(), modePipe, and Pipe::Notify().

Referenced by Channel::RemoveMode(), User::RemoveMode(), Server::Server(), Channel::SetMode(), and User::SetMode().

void ModeManager::StackerAdd ( BotInfo bi,
User u,
UserMode um,
bool  set,
const Anope::string param = "" 

Add a mode to the stacker to be set on a user

biThe client to set the modes from
uThe user
umThe user mode
settrue for setting, false for removing
paramThe param, if there is one

Definition at line 621 of file modes.cpp.

References StackerInfo::AddMode(), StackerInfo::bi, GetInfo(), modePipe, Pipe::Notify(), and UserStackerObjects.

void ModeManager::StackerDel ( User u)

Delete a user, channel, or mode from the stacker

Definition at line 682 of file modes.cpp.

References UserStackerObjects.

Referenced by RemoveChannelMode(), RemoveUserMode(), StackerDel(), Channel::~Channel(), and User::~User().

void ModeManager::StackerDel ( Channel c)

Definition at line 687 of file modes.cpp.

References ChannelStackerObjects, and StackerDel().

void ModeManager::StackerDel ( Mode m)

Field Documentation

unsigned ModeManager::GenericChannelModes = 0

Definition at line 297 of file modes.h.

Referenced by AddChannelMode().

unsigned ModeManager::GenericUserModes = 0

Definition at line 298 of file modes.h.

Referenced by AddUserMode().

The documentation for this class was generated from the following files: