1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * --------------------------------------------------
17 #ifndef __SNOMASKS_H__
18 #define __SNOMASKS_H__
23 #include "configreader.h"
26 /** A list of snomasks which are valid, and their descriptive texts
28 typedef std::map<char, std::string> SnoList;
30 /** Snomask manager handles routing of SNOMASK (usermode +n) messages to opers.
31 * Modules and the core can enable and disable snomask characters. If they do,
32 * then sending snomasks using these characters becomes possible.
34 class SnomaskManager : public Extensible
39 InspIRCd* ServerInstance;
40 /** Currently active snomask list
43 /** Set up the default (core available) snomask chars
47 /** Create a new SnomaskManager
49 SnomaskManager(InspIRCd* Instance);
50 /** Delete 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".
60 * @return True if the snomask was enabled, false if it already
63 bool EnableSnomask(char letter, const std::string &description);
64 /** Disable a snomask.
65 * @param letter The snomask letter to disable.
66 * @return True if the snomask was disabled, false if it didn't
69 bool DisableSnomask(char letter);
70 /** Write to all users with a given snomask.
71 * @param letter The snomask letter to write to
72 * @param text The text to send to the users
74 void WriteToSnoMask(char letter, const std::string &text);
75 /** Write to all users with a given snomask.
76 * @param letter The snomask letter to write to
77 * @param text A format string containing text to send
78 * @param ... Format arguments
80 void WriteToSnoMask(char letter, const char* text, ...);
81 /** Check if a snomask is enabled.
82 * @param letter The snomask letter to check.
83 * @return True if the snomask has been enabled.
85 bool IsEnabled(char letter);