InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
snomasks.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
5  * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
6  * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7  * Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
8  *
9  * This file is part of InspIRCd. InspIRCd is free software: you can
10  * redistribute it and/or modify it under the terms of the GNU General Public
11  * License as published by the Free Software Foundation, version 2.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef SNOMASKS_H
24 #define SNOMASKS_H
25 
26 class Snomask
27 {
28  public:
29  std::string Description;
30  std::string LastMessage;
31  int Count;
32  bool LastBlocked;
33  char LastLetter;
34 
37  Snomask() : Count(0), LastBlocked(false), LastLetter(0)
38  {
39  }
40 
43  void SendMessage(const std::string &message, char letter);
44 
47  void Flush();
48 };
49 
54 class CoreExport SnomaskManager
55 {
56  public:
57  Snomask masks[26];
58 
62 
70  void EnableSnomask(char letter, const std::string &description);
71 
76  void WriteToSnoMask(char letter, const std::string &text);
77 
83  void WriteToSnoMask(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
84 
89  void WriteGlobalSno(char letter, const std::string &text);
90 
96  void WriteGlobalSno(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
97 
98 
107  void FlushSnotices();
108 };
109 
110 #endif
Definition: snomasks.h:26
void Flush()
Definition: snomasks.cpp:133
Snomask()
Definition: snomasks.h:37
void SendMessage(const std::string &message, char letter)
Definition: snomasks.cpp:93
Definition: snomasks.h:54