1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
20 std::string Description;
21 std::string LastMessage;
26 /** Create a new Snomask
28 Snomask() : Count(0), LastBlocked(false), LastLetter(0)
32 /** Sends a message to all opers with this snomask.
34 void SendMessage(const std::string &message, char letter);
36 /** Sends out the (last message repeated N times) message
41 /** Snomask manager handles routing of SNOMASK (usermode +n) messages to opers.
42 * Modules and the core can enable and disable snomask characters. If they do,
43 * then sending snomasks using these characters becomes possible.
45 class CoreExport SnomaskManager
50 /** Create a new SnomaskManager
55 * @param letter The snomask letter to enable. Once enabled,
56 * server notices may be routed to users with this letter in
57 * their list, and users may add this letter to their list.
58 * @param description The descriptive text sent along with any
59 * server notices, at the start of the notice, e.g. "GLOBOPS".
61 void EnableSnomask(char letter, const std::string &description);
63 /** Write to all users with a given snomask (local server only)
64 * @param letter The snomask letter to write to
65 * @param text The text to send to the users
67 void WriteToSnoMask(char letter, const std::string &text);
69 /** Write to all users with a given snomask (local server only)
70 * @param letter The snomask letter to write to
71 * @param text A format string containing text to send
72 * @param ... Format arguments
74 void WriteToSnoMask(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
76 /** Write to all users with a given snomask (sent globally)
77 * @param letter The snomask letter to write to
78 * @param text The text to send to the users
80 void WriteGlobalSno(char letter, const std::string &text);
82 /** Write to all users with a given snomask (sent globally)
83 * @param letter The snomask letter to write to
84 * @param text A format string containing text to send
85 * @param ... Format arguments
87 void WriteGlobalSno(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
90 /** Called once per 5 seconds from the mainloop, this flushes any cached
91 * snotices. The way the caching works is as follows:
92 * Calls to WriteToSnoMask write to a cache, if the call is the same as it was
93 * for the previous call, then a count is incremented. If it is different,
94 * the previous message it just sent normally via NOTICE (with count if > 1)
95 * and the new message is cached. This acts as a sender in case the number of notices
96 * is not particularly significant, in order to keep notices going out.