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

◆ AddChannelMode()

bool ModeManager::AddChannelMode ( ChannelMode cm)

◆ AddUserMode()

bool ModeManager::AddUserMode ( UserMode um)

◆ FindChannelModeByChar()

ChannelMode * ModeManager::FindChannelModeByChar ( char  mode)

◆ FindChannelModeByName()

ChannelMode * ModeManager::FindChannelModeByName ( const Anope::string name)

◆ FindUserModeByChar()

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().

◆ FindUserModeByName()

UserMode * ModeManager::FindUserModeByName ( const Anope::string name)

◆ GetChannelModes()

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().

◆ GetStatusChannelModesByRank()

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

◆ GetStatusChar()

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().

◆ GetUserModes()

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

Definition at line 576 of file modes.cpp.

References UserModes.

◆ ProcessModes()

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().

◆ RebuildStatusModes()

void ModeManager::RebuildStatusModes ( )

Definition at line 594 of file modes.cpp.

References ChannelModesByStatus, ChannelModesIdx, MODE_STATUS, statuscmp, and Mode::type.

Referenced by IRCDMessageCapab::Run().

◆ RemoveChannelMode()

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, StackerDel(), ChannelModeStatus::symbol, and Mode::type.

◆ RemoveUserMode()

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.

◆ StackerAdd() [1/2]

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().

◆ StackerAdd() [2/2]

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.

◆ StackerDel() [1/3]

void ModeManager::StackerDel ( User u)

Delete a user, channel, or mode from the stacker

Definition at line 682 of file modes.cpp.

References StackerDel(), and UserStackerObjects.

Referenced by Channel::~Channel(), and User::~User().

◆ StackerDel() [2/3]

void ModeManager::StackerDel ( Channel c)

Definition at line 687 of file modes.cpp.

References ChannelStackerObjects, and StackerDel().

◆ StackerDel() [3/3]

void ModeManager::StackerDel ( Mode m)

Field Documentation

◆ GenericChannelModes

unsigned ModeManager::GenericChannelModes = 0

Definition at line 297 of file modes.h.

◆ GenericUserModes

unsigned ModeManager::GenericUserModes = 0

Definition at line 298 of file modes.h.

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