summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-29 18:26:55 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-29 18:26:55 +0000
commitb9e99da4dafd836e995970216835cefe3716a01a (patch)
tree3e1a53384d20e350adf6a23ac964b9429e735e6b /include
parente7aac9ee56d7bfff83287e3068ac18f60d43a1f9 (diff)
Snomask support cometh! and it leave a sticky white mess all over the floor :(
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5062 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h7
-rw-r--r--include/snomasks.h10
-rw-r--r--include/users.h7
3 files changed, 20 insertions, 4 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 965cf44fc..dfc36a720 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -25,9 +25,9 @@
#include "channels.h"
#include "socket.h"
#include "mode.h"
-
#include "socketengine.h"
#include "command_parse.h"
+#include "snomasks.h"
/** Returned by some functions to indicate failure,
* and the exit code of the program if it terminates.
@@ -373,6 +373,11 @@ class InspIRCd : public classbase
*/
ServerConfig* Config;
+ /** Snomask manager - handles routing of snomask messages
+ * to opers.
+ */
+ SnomaskManager* SNO;
+
/** Client list, a hash_map containing all clients, local and remote
*/
user_hash clientlist;
diff --git a/include/snomasks.h b/include/snomasks.h
index ab8980c26..a6ee0d050 100644
--- a/include/snomasks.h
+++ b/include/snomasks.h
@@ -19,18 +19,26 @@
#include <string>
#include <vector>
+#include <map>
#include "configreader.h"
#include "inspircd.h"
+typedef std::map<char, std::string> SnoList;
+
class SnomaskManager : public Extensible
{
private:
InspIRCd* ServerInstance;
+ SnoList SnoMasks;
public:
SnomaskManager(InspIRCd* Instance);
~SnomaskManager();
-
+ bool EnableSnomask(char letter, const std::string &description);
+ bool DisableSnomask(char letter);
+ void WriteToSnoMask(char letter, const std::string &text);
+ void WriteToSnoMask(char letter, const char* text, ...);
+ bool IsEnabled(char letter);
};
#endif
diff --git a/include/users.h b/include/users.h
index 83ea9bf3f..731cb785a 100644
--- a/include/users.h
+++ b/include/users.h
@@ -46,6 +46,7 @@ enum UserModes {
UM_WALLOPS = 'w'-65,
UM_INVISIBLE = 'i'-65,
UM_OPERATOR = 'o'-65,
+ UM_SNOMASK = 'n'-65,
};
enum RegistrationState {
@@ -372,9 +373,11 @@ class userrec : public connection
/** Process a snomask modifier string, e.g. +abc-de
* @param sm A sequence of notice mask characters
- * @return True if the notice masks were successfully applied
+ * @return The cleaned mode sequence which can be output,
+ * e.g. in the above example if masks c and e are not
+ * valid, this function will return +ab-d
*/
- bool userrec::ProcessNoticeMasks(const char *sm);
+ std::string userrec::ProcessNoticeMasks(const char *sm);
/** Returns true if a notice mask is set
* @param sm A notice mask character to check