InspIRCd  3.0
Public Member Functions | List of all members
SnomaskManager Class Reference

#include <snomasks.h>

Inheritance diagram for SnomaskManager:
fakederef< SnomaskManager >

Public Member Functions

 SnomaskManager ()
 
void EnableSnomask (char letter, const std::string &description)
 
void WriteToSnoMask (char letter, const std::string &text)
 
void WriteToSnoMask (char letter, const char *text,...) CUSTOM_PRINTF(3
 
void void WriteGlobalSno (char letter, const std::string &text)
 
void WriteGlobalSno (char letter, const char *text,...) CUSTOM_PRINTF(3
 
void void FlushSnotices ()
 
bool IsSnomaskUsable (char ch) const
 
- Public Member Functions inherited from fakederef< SnomaskManager >
SnomaskManageroperator-> ()
 

Detailed Description

Snomask manager handles routing of SNOMASK (usermode +s) messages to opers. Modules and the core can enable and disable snomask characters. If they do, then sending snomasks using these characters becomes possible.

Constructor & Destructor Documentation

◆ SnomaskManager()

SnomaskManager::SnomaskManager ( )

Create a new SnomaskManager

Member Function Documentation

◆ EnableSnomask()

void SnomaskManager::EnableSnomask ( char  letter,
const std::string &  description 
)

Enable a snomask.

Parameters
letterThe 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.
descriptionThe descriptive text sent along with any server notices, at the start of the notice, e.g. "GLOBOPS".

◆ FlushSnotices()

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.

◆ IsSnomaskUsable()

bool SnomaskManager::IsSnomaskUsable ( char  ch) const

Check whether a given character is an enabled (initialized) snomask. Valid snomask chars are lower- or uppercase letters and have a description. Snomasks are initialized with EnableSnomask().

Parameters
chThe character to check
Returns
True if the given char is allowed to be set via +s.

◆ WriteGlobalSno() [1/2]

void SnomaskManager::WriteGlobalSno ( char  letter,
const std::string &  text 
)

Write to all users with a given snomask (sent globally)

Parameters
letterThe snomask letter to write to
textThe text to send to the users

◆ WriteGlobalSno() [2/2]

void SnomaskManager::WriteGlobalSno ( char  letter,
const char *  text,
  ... 
)

Write to all users with a given snomask (sent globally)

Parameters
letterThe snomask letter to write to
textA format string containing text to send
...Format arguments

◆ WriteToSnoMask() [1/2]

void SnomaskManager::WriteToSnoMask ( char  letter,
const std::string &  text 
)

Write to all users with a given snomask (local server only)

Parameters
letterThe snomask letter to write to
textThe text to send to the users

◆ WriteToSnoMask() [2/2]

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

Write to all users with a given snomask (local server only)

Parameters
letterThe snomask letter to write to
textA format string containing text to send
...Format arguments

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