1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __SNOMASKS_H__
15 #define __SNOMASKS_H__
20 #include "configreader.h"
23 /** A list of snomasks which are valid, and their descriptive texts
25 typedef std::map<char, std::string> SnoList;
27 /** Snomask manager handles routing of SNOMASK (usermode +n) messages to opers.
28 * Modules and the core can enable and disable snomask characters. If they do,
29 * then sending snomasks using these characters becomes possible.
31 class CoreExport SnomaskManager : public Extensible
36 InspIRCd* ServerInstance;
37 /** Currently active snomask list
40 /** Set up the default (core available) snomask chars
44 /** Create a new SnomaskManager
46 SnomaskManager(InspIRCd* Instance);
47 /** Delete SnomaskManager
52 * @param letter The snomask letter to enable. Once enabled,
53 * server notices may be routed to users with this letter in
54 * their list, and users may add this letter to their list.
55 * @param description The descriptive text sent along with any
56 * server notices, at the start of the notice, e.g. "GLOBOPS".
57 * @return True if the snomask was enabled, false if it already
60 bool EnableSnomask(char letter, const std::string &description);
61 /** Disable a snomask.
62 * @param letter The snomask letter to disable.
63 * @return True if the snomask was disabled, false if it didn't
66 bool DisableSnomask(char letter);
67 /** Write to all users with a given snomask.
68 * @param letter The snomask letter to write to
69 * @param text The text to send to the users
71 void WriteToSnoMask(char letter, const std::string &text);
72 /** Write to all users with a given snomask.
73 * @param letter The snomask letter to write to
74 * @param text A format string containing text to send
75 * @param ... Format arguments
77 void WriteToSnoMask(char letter, const char* text, ...);
78 /** Check if a snomask is enabled.
79 * @param letter The snomask letter to check.
80 * @return True if the snomask has been enabled.
82 bool IsEnabled(char letter);