|
|||
|
|||
|
#include <snomasks.h>
Inheritance diagram for SnomaskManager:


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,...) |
| Write to all users with a given snomask. | |
| 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 | |
| InspIRCd * | ServerInstance |
| Creator/owner. | |
| SnoList | SnoMasks |
| Currently active snomask list. | |
Modules and the core can enable and disable snomask characters. If they do, then sending snomasks using these characters becomes possible.
Definition at line 31 of file snomasks.h.
|
|
Create a new SnomaskManager.
Definition at line 20 of file snomasks.cpp. References SetupDefaults(), and SnoMasks. 00020 : ServerInstance(Instance) 00021 { 00022 SnoMasks.clear(); 00023 this->SetupDefaults(); 00024 }
|
|
|
Delete SnomaskManager.
Definition at line 26 of file snomasks.cpp.
|
|
|
Disable a snomask.
Definition at line 40 of file snomasks.cpp. References SnoMasks. Referenced by ModuleChanCreate::~ModuleChanCreate(), ModuleGlobops::~ModuleGlobops(), ModuleOverride::~ModuleOverride(), and ModuleSeeNicks::~ModuleSeeNicks(). 00041 { 00042 SnoList::iterator n = SnoMasks.find(letter); 00043 if (n != SnoMasks.end()) 00044 { 00045 SnoMasks.erase(n); 00046 return true; 00047 } 00048 return false; 00049 }
|
|
||||||||||||
|
Enable a snomask.
Definition at line 30 of file snomasks.cpp. References SnoMasks. Referenced by ModuleChanCreate::ModuleChanCreate(), ModuleGlobops::ModuleGlobops(), ModuleOverride::ModuleOverride(), ModuleSeeNicks::ModuleSeeNicks(), and SetupDefaults(). 00031 { 00032 if (SnoMasks.find(letter) == SnoMasks.end()) 00033 { 00034 SnoMasks[letter] = type; 00035 return true; 00036 } 00037 return false; 00038 }
|
|
|
Check if a snomask is enabled.
Definition at line 82 of file snomasks.cpp. References SnoMasks. Referenced by userrec::ProcessNoticeMasks().
|
|
|
Set up the default (core available) snomask chars.
Definition at line 87 of file snomasks.cpp. References EnableSnomask(). Referenced by SnomaskManager(). 00088 { 00089 this->EnableSnomask('c',"CONNECT"); /* Local connect notices */ 00090 this->EnableSnomask('C',"REMOTECONNECT"); /* Remote connect notices */ 00091 this->EnableSnomask('q',"QUIT"); /* Local quit notices */ 00092 this->EnableSnomask('Q',"REMOTEQUIT"); /* Remote quit notices */ 00093 this->EnableSnomask('k',"KILL"); /* Kill notices */ 00094 this->EnableSnomask('K',"REMOTEKILL"); /* Remote kill notices */ 00095 this->EnableSnomask('l',"LINK"); /* Link notices */ 00096 this->EnableSnomask('o',"OPER"); /* Oper up/down notices */ 00097 this->EnableSnomask('d',"DEBUG"); /* Debug notices */ 00098 this->EnableSnomask('x',"XLINE"); /* Xline notice (g/z/q/k/e) */ 00099 this->EnableSnomask('t',"STATS"); /* Local or remote stats request */ 00100 this->EnableSnomask('f',"FLOOD"); /* Flooding notices */ 00101 }
|
|
||||||||||||||||
|
Write to all users with a given snomask.
Definition at line 70 of file snomasks.cpp. References MAXBUF, and WriteToSnoMask(). 00071 { 00072 char textbuffer[MAXBUF]; 00073 va_list argsPtr; 00074 00075 va_start(argsPtr, text); 00076 vsnprintf(textbuffer, MAXBUF, text, argsPtr); 00077 va_end(argsPtr); 00078 00079 this->WriteToSnoMask(letter, std::string(textbuffer)); 00080 }
|
|
||||||||||||
|
|
Creator/owner.
Definition at line 36 of file snomasks.h. Referenced by WriteToSnoMask(). |
|
|
Currently active snomask list.
Definition at line 39 of file snomasks.h. Referenced by DisableSnomask(), EnableSnomask(), IsEnabled(), SnomaskManager(), and WriteToSnoMask(). |