The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

SnomaskManager Class Reference

Snomask manager handles routing of SNOMASK (usermode +n) messages to opers. More...

#include <snomasks.h>

Inheritance diagram for SnomaskManager:

Inheritance graph
[legend]
Collaboration diagram for SnomaskManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SnomaskManager (InspIRCd *Instance)
 Create a new SnomaskManager.
 ~SnomaskManager ()
 Delete SnomaskManager.
bool EnableSnomask (char letter, const std::string &description)
 Enable a snomask.
bool DisableSnomask (char letter)
 Disable a snomask.
void WriteToSnoMask (char letter, const std::string &text)
 Write to all users with a given snomask.
void WriteToSnoMask (char letter, const char *text,...) CUSTOM_PRINTF(3
 Write to all users with a given snomask.
void void FlushSnotices ()
 Called once per 5 seconds from the mainloop, this flushes any cached snotices.
bool IsEnabled (char letter)
 Check if a snomask is enabled.

Private Member Functions

void SetupDefaults ()
 Set up the default (core available) snomask chars.

Private Attributes

InspIRCdServerInstance
 Creator/owner.
SnoList SnoMasks
 Currently active snomask list.

Detailed Description

Snomask manager handles routing of SNOMASK (usermode +n) messages to opers.

Modules and the core can enable and disable snomask characters. If they do, then sending snomasks using these characters becomes possible.

Definition at line 51 of file snomasks.h.


Constructor & Destructor Documentation

SnomaskManager::SnomaskManager InspIRCd Instance  ) 
 

Create a new SnomaskManager.

Definition at line 20 of file snomasks.cpp.

References SetupDefaults(), and SnoMasks.

SnomaskManager::~SnomaskManager  ) 
 

Delete SnomaskManager.

Definition at line 26 of file snomasks.cpp.

References SnoMasks.


Member Function Documentation

bool SnomaskManager::DisableSnomask char  letter  ) 
 

Disable a snomask.

Parameters:
letter The snomask letter to disable.
Returns:
True if the snomask was disabled, false if it didn't exist.

Definition at line 54 of file snomasks.cpp.

References SnoMasks.

Referenced by ModuleChanCreate::~ModuleChanCreate(), ModuleGlobops::~ModuleGlobops(), ModuleOverride::~ModuleOverride(), and ModuleSeeNicks::~ModuleSeeNicks().

bool SnomaskManager::EnableSnomask char  letter,
const std::string description
 

Enable a snomask.

Parameters:
letter The snomask letter to enable. Once enabled, server notices may be routed to users with this letter in their list, and users may add this letter to their list.
description The descriptive text sent along with any server notices, at the start of the notice, e.g. "GLOBOPS".
Returns:
True if the snomask was enabled, false if it already exists.

Definition at line 43 of file snomasks.cpp.

References ServerInstance, and SnoMasks.

Referenced by ModuleChanCreate::ModuleChanCreate(), ModuleGlobops::ModuleGlobops(), ModuleOverride::ModuleOverride(), ModuleSeeNicks::ModuleSeeNicks(), and SetupDefaults().

void SnomaskManager::FlushSnotices  ) 
 

Called once per 5 seconds from the mainloop, this flushes any cached snotices.

The way the caching works is as follows: Calls to WriteToSnoMask write to a cache, if the call is the same as it was for the previous call, then a count is incremented. If it is different, the previous message it just sent normally via NOTICE (with count if > 1) and the new message is cached. This acts as a sender in case the number of notices is not particularly significant, in order to keep notices going out.

Definition at line 35 of file snomasks.cpp.

References SnoMasks.

Referenced by InspIRCd::Run().

bool SnomaskManager::IsEnabled char  letter  ) 
 

Check if a snomask is enabled.

Parameters:
letter The snomask letter to check.
Returns:
True if the snomask has been enabled.

Definition at line 88 of file snomasks.cpp.

References SnoMasks.

Referenced by User::ProcessNoticeMasks().

void SnomaskManager::SetupDefaults  )  [private]
 

Set up the default (core available) snomask chars.

Definition at line 93 of file snomasks.cpp.

References EnableSnomask().

Referenced by SnomaskManager().

void SnomaskManager::WriteToSnoMask char  letter,
const char *  text,
  ...
 

Write to all users with a given snomask.

Parameters:
letter The snomask letter to write to
text A format string containing text to send
... Format arguments

Definition at line 76 of file snomasks.cpp.

References MAXBUF, and WriteToSnoMask().

void SnomaskManager::WriteToSnoMask char  letter,
const std::string text
 

Write to all users with a given snomask.

Parameters:
letter The snomask letter to write to
text The text to send to the users

Definition at line 66 of file snomasks.cpp.

References SnoMasks.

Referenced by User::AddBuffer(), TreeSocket::AddLine(), UserManager::AddUser(), User::AddWriteBuf(), CullList::Apply(), ModuleSpanningTree::AutoConnectServers(), User::CheckClass(), ModuleSQLAuth::CheckCredentials(), ModuleLDAPAuth::CheckCredentials(), ModuleCgiIRC::CheckIdent(), ModuleCgiIRC::CheckPass(), ModuleLDAPAuth::Connect(), ModuleSpanningTree::ConnectServer(), TreeSocket::DelLine(), GLine::DisplayExpiry(), KLine::DisplayExpiry(), ZLine::DisplayExpiry(), QLine::DisplayExpiry(), ELine::DisplayExpiry(), SVSHold::DisplayExpiry(), Shun::DisplayExpiry(), RLine::DisplayExpiry(), CBan::DisplayExpiry(), ModuleAlias::DoAlias(), TreeSocket::DoBurst(), ModuleSpanningTree::DoConnectTimeout(), SpanningTreeUtilities::DoFailOver(), ModuleSpanningTree::DoPingChecks(), TreeSocket::Error(), ModuleZLib::Error(), TreeServer::FinishBurst(), TreeSocket::ForceJoin(), TreeSocket::ForceMode(), User::FullConnect(), cmd_rsquit::Handle(), cmd_rconnect::Handle(), CommandSwhois::Handle(), CommandSvshold::Handle(), cmd_shun::Handle(), CommandSetname::Handle(), CommandSetidle::Handle(), CommandSetident::Handle(), CommandSethost::Handle(), CommandSATopic::Handle(), CommandSaquit::Handle(), CommandSapart::Handle(), CommandSanick::Handle(), CommandSamode::Handle(), CommandSajoin::Handle(), CommandRLine::Handle(), CommandNickunlock::Handle(), CommandNicklock::Handle(), CommandUnlockserv::Handle(), CommandLockserv::Handle(), CommandGlobops::Handle(), CommandGreloadmodule::Handle(), CommandGunloadmodule::Handle(), CommandGloadmodule::Handle(), CommandTitle::Handle(), CommandChgname::Handle(), CommandChgident::Handle(), CommandChghost::Handle(), CommandWebirc::Handle(), CommandCBan::Handle(), cmd_reload::Handle(), ModuleSpanningTree::HandleSquit(), InspIRCd::HostMatchesEveryone(), TreeSocket::Inbound_Server(), InspIRCd::IPMatchesEveryone(), InspIRCd::NickMatchesEveryone(), ServerSocketListener::OnAcceptReady(), TreeSocket::OnClose(), TreeSocket::OnConnected(), TreeSocket::OnError(), ServernameResolver::OnError(), CGIResolver::OnError(), ModuleServProtectMode::OnKill(), ModuleOperLevels::OnKill(), ModuleRLine::OnLoadModule(), FilterBase::OnLoadModule(), ModuleOverride::OnLocalTopicChange(), ServernameResolver::OnLookupComplete(), DNSBLResolver::OnLookupComplete(), CGIResolver::OnLookupComplete(), ModeUserOperator::OnModeChange(), InvisibleMode::OnModeChange(), ModuleOverride::OnPostCommand(), ModuleOperSSLCert::OnPreCommand(), ModuleBlockAmsg::OnPreCommand(), ModuleRLine::OnRehash(), FilterBase::OnRehash(), ModuleSQLAuth::OnRequest(), TreeSocket::OnTimeout(), ModuleConnectBan::OnUserConnect(), ModuleInvisible::OnUserJoin(), ModuleChanCreate::OnUserJoin(), ModuleSeeNicks::OnUserPostNick(), ModuleOverride::OnUserPreJoin(), ModuleCBan::OnUserPreJoin(), ModuleOverride::OnUserPreKick(), FilterBase::OnUserPreNotice(), ModuleConnFlood::OnUserRegister(), User::Oper(), TreeSocket::OperType(), TreeSocket::Outbound_Reply_Server(), TreeSocket::ParseUID(), CommandParser::ProcessCommand(), TreeSocket::ProcessLine(), ServerConfig::Read(), ModuleDNSBL::ReadConf(), ModuleXLineDB::ReadDatabase(), TreeSocket::RemoteServer(), ServerConfig::ReportConfigError(), RLine::RLine(), InspIRCd::Run(), TreeSocket::SendError(), TreeSocket::Squit(), ModuleXLineDB::WriteDatabase(), and WriteToSnoMask().


Member Data Documentation

InspIRCd* SnomaskManager::ServerInstance [private]
 

Creator/owner.

Definition at line 56 of file snomasks.h.

Referenced by EnableSnomask().

SnoList SnomaskManager::SnoMasks [private]
 

Currently active snomask list.

Definition at line 60 of file snomasks.h.

Referenced by DisableSnomask(), EnableSnomask(), FlushSnotices(), IsEnabled(), SnomaskManager(), WriteToSnoMask(), and ~SnomaskManager().


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