summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bahamut.c5
-rw-r--r--src/chanserv.c17
-rw-r--r--src/dreamforge.c3
-rw-r--r--src/hybrid.c2
-rw-r--r--src/modules.c34
-rw-r--r--src/plexus.c2
-rw-r--r--src/ptlink.c2
-rw-r--r--src/rageircd.c2
-rw-r--r--src/ratbox.c2
-rw-r--r--src/shadowircd.c2
-rw-r--r--src/solidircd.c2
-rw-r--r--src/ultimate2.c2
-rw-r--r--src/ultimate3.c2
-rw-r--r--src/unreal31.c2
-rw-r--r--src/unreal32.c2
-rw-r--r--src/viagra.c2
16 files changed, 72 insertions, 11 deletions
diff --git a/src/bahamut.c b/src/bahamut.c
index 253ec662c..a54cd4988 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -643,6 +643,11 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ /* first update the cs protect info about this ircd */
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
+
+ /* now add the commands */
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/chanserv.c b/src/chanserv.c
index d373e9f95..1fad54961 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -62,17 +62,12 @@ static int def_levels[][2] = {
{ -1 }
};
-typedef struct {
- int what;
- char *name;
- int desc;
-} LevelInfo;
-static LevelInfo levelinfo[] = {
+LevelInfo levelinfo[] = {
{ CA_AUTODEOP, "AUTODEOP", CHAN_LEVEL_AUTODEOP },
{ CA_AUTOHALFOP, "AUTOHALFOP", CHAN_LEVEL_AUTOHALFOP },
{ CA_AUTOOP, "AUTOOP", CHAN_LEVEL_AUTOOP },
- { CA_AUTOPROTECT, LEVEL_PROTECT_WORD, CHAN_LEVEL_AUTOPROTECT },
+ { CA_AUTOPROTECT, "", CHAN_LEVEL_AUTOPROTECT },
{ CA_AUTOVOICE, "AUTOVOICE", CHAN_LEVEL_AUTOVOICE },
{ CA_NOJOIN, "NOJOIN", CHAN_LEVEL_NOJOIN },
{ CA_SIGNKICK, "SIGNKICK", CHAN_LEVEL_SIGNKICK },
@@ -92,8 +87,8 @@ static LevelInfo levelinfo[] = {
{ CA_INVITE, "INVITE", CHAN_LEVEL_INVITE },
{ CA_OPDEOP, "OPDEOP", CHAN_LEVEL_OPDEOP },
{ CA_OPDEOPME, "OPDEOPME", CHAN_LEVEL_OPDEOPME },
- { CA_PROTECT, LEVELINFO_PROTECT_WORD, CHAN_LEVEL_PROTECT },
- { CA_PROTECTME, LEVELINFO_PROTECTME_WORD, CHAN_LEVEL_PROTECTME },
+ { CA_PROTECT, "", CHAN_LEVEL_PROTECT },
+ { CA_PROTECTME, "", CHAN_LEVEL_PROTECTME },
{ CA_TOPIC, "TOPIC", CHAN_LEVEL_TOPIC },
{ CA_UNBAN, "UNBAN", CHAN_LEVEL_UNBAN },
{ CA_VOICE, "VOICE", CHAN_LEVEL_VOICE },
@@ -116,8 +111,8 @@ CSModeUtil csmodeutils[] = {
{ "VOICE", "!voice", "+v", 0 , CA_VOICE, CA_VOICEME },
{ "DEHALFOP", "!dehalfop", "-h", 0 , CA_HALFOP, CA_HALFOPME },
{ "HALFOP", "!halfop", "+h", 0 , CA_HALFOP, CA_HALFOPME },
- { "DEPROTECT", FANT_PROTECT_DEL, PROTECT_UNSET_MODE, 0 , CA_PROTECT, CA_PROTECTME },
- { "PROTECT", FANT_PROTECT_ADD, PROTECT_SET_MODE, 0 , CA_PROTECT, CA_PROTECTME },
+ { "DEPROTECT", "", "", 0 , CA_PROTECT, CA_PROTECTME },
+ { "PROTECT", "", "", 0 , CA_PROTECT, CA_PROTECTME },
{ NULL }
};
diff --git a/src/dreamforge.c b/src/dreamforge.c
index c82a279f3..c4b3dc5f0 100644
--- a/src/dreamforge.c
+++ b/src/dreamforge.c
@@ -460,8 +460,11 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
+
Message *m;
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/hybrid.c b/src/hybrid.c
index ebdccfcec..763bca0fe 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -627,6 +627,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/modules.c b/src/modules.c
index a65af3230..1e8de369e 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -2124,4 +2124,38 @@ const char *ano_moderr(void)
}
#endif
+/**
+ * Allow ircd protocol files to update the protect level info tables.
+ **/
+void updateProtectDetails(char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode) {
+ int i = 0;
+ CSModeUtil ptr;
+ LevelInfo l_ptr;
+
+ ptr = csmodeutils[i];
+ while(ptr.name) {
+ if(strcmp(ptr.name,"PROTECT")==0) {
+ csmodeutils[i].bsname = strdup(fant_protect_add);
+ csmodeutils[i].mode = strdup(protect_set_mode);
+ } else if(strcmp(ptr.name,"DEPROTECT")==0) {
+ csmodeutils[i].bsname = strdup(fant_protect_del);
+ csmodeutils[i].mode = strdup(protect_unset_mode);
+ }
+ ptr = csmodeutils[++i];
+ }
+
+ i = 0;
+ l_ptr = levelinfo[i];
+ while(l_ptr.what != -1) {
+ if(l_ptr.what == CA_PROTECT) {
+ levelinfo[i].name = strdup(level_info_protect_word);
+ } else if(l_ptr.what == CA_PROTECTME) {
+ levelinfo[i].name = strdup(level_info_protectme_word);
+ } else if(l_ptr.what == CA_AUTOPROTECT) {
+ levelinfo[i].name = strdup(level_protect_word);
+ }
+ l_ptr = levelinfo[++i];
+ }
+}
+
/* EOF */
diff --git a/src/plexus.c b/src/plexus.c
index f88886beb..538b19a8f 100644
--- a/src/plexus.c
+++ b/src/plexus.c
@@ -687,6 +687,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
diff --git a/src/ptlink.c b/src/ptlink.c
index 5960f4bd9..7528351f9 100644
--- a/src/ptlink.c
+++ b/src/ptlink.c
@@ -526,6 +526,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
diff --git a/src/rageircd.c b/src/rageircd.c
index 8d3470f7b..f6b968496 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -505,6 +505,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ updateProtectDetails("ADMIN","ADMINME","!admin","!deadmin","AUTOADMIN","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
diff --git a/src/ratbox.c b/src/ratbox.c
index 00e4b756f..b8db22dd6 100644
--- a/src/ratbox.c
+++ b/src/ratbox.c
@@ -732,6 +732,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void)
{
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
if (UseTS6) {
TS6SID = sstrdup(Numeric);
diff --git a/src/shadowircd.c b/src/shadowircd.c
index 1b52b8b73..0f2920016 100644
--- a/src/shadowircd.c
+++ b/src/shadowircd.c
@@ -736,6 +736,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void)
{
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
TS6SID = sstrdup(Numeric);
UseTS6 = 1;
diff --git a/src/solidircd.c b/src/solidircd.c
index 836b2a242..4cf78e85a 100644
--- a/src/solidircd.c
+++ b/src/solidircd.c
@@ -649,6 +649,8 @@ int anope_event_436(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+","-");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
diff --git a/src/ultimate2.c b/src/ultimate2.c
index f5552e067..149e94236 100644
--- a/src/ultimate2.c
+++ b/src/ultimate2.c
@@ -592,6 +592,8 @@ int anope_event_436(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
diff --git a/src/ultimate3.c b/src/ultimate3.c
index 0e567abc9..b4f9c3176 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -594,6 +594,8 @@ int anope_event_client(char *source, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+ updateProtectDetails("ADMIN","ADMINME","!admin","!deadmin","AUTOADMIN","+a","-a");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/unreal31.c b/src/unreal31.c
index d82d515c5..254e3137c 100644
--- a/src/unreal31.c
+++ b/src/unreal31.c
@@ -433,6 +433,8 @@ void anope_set_umode(User * user, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/unreal32.c b/src/unreal32.c
index 762031eda..3a520e086 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -486,6 +486,8 @@ void anope_set_umode(User * user, int ac, char **av)
void moduleAddIRCDMsgs(void) {
Message *m;
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
+
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
diff --git a/src/viagra.c b/src/viagra.c
index 8e215a604..de1ef6074 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -674,6 +674,8 @@ int anope_event_error(char *source, int ac, char **av)
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void) {
Message *m;
+
+ updateProtectDetails("PROTECT","PROTECTME","!protect","!deprotect","AUTOPROTECT","+a","-a");
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);