]> jfr.im git - irc/freenode/syn.git/commitdiff
masks.c: add help files origin/devel
authorJanik Kleinhoff <redacted>
Wed, 23 Jan 2019 05:29:58 +0000 (05:29 +0000)
committerJanik Kleinhoff <redacted>
Wed, 23 Jan 2019 05:29:58 +0000 (05:29 +0000)
help/addmask [new file with mode: 0644]
help/delmask [new file with mode: 0644]
help/listmask [new file with mode: 0644]
help/setmask [new file with mode: 0644]
masks.c

diff --git a/help/addmask b/help/addmask
new file mode 100644 (file)
index 0000000..2f80baf
--- /dev/null
@@ -0,0 +1,20 @@
+Help for \ 2ADDMASK\ 2:
+
+This command adds a mask that will report and optionally k-line
+matching masks, or one that is exempt from other masks.
+
+Masks are matched against "\ 2nick!user@host gecos\ 2" whenever
+a user connects or changes nick.
+
+Possible types are:
+
+ - suspicious: matches will be reported in the report channel
+ - lethal: matches will be reported and k-lined
+ - exempt: matches are exempt from other types of mask
+
+Syntax: ADDMASK /<regex>/[i] <type> [~<duration>]
+
+Examples:
+    /msg &nick& ADDMASK /^spambot\d+/i lethal
+    /msg &nick& ADDMASK / .*notalogbot/ suspicious ~30m
+    /msg &nick& ADDMASK /@freenode\/staff\/.* / exempt
diff --git a/help/delmask b/help/delmask
new file mode 100644 (file)
index 0000000..6822a2e
--- /dev/null
@@ -0,0 +1,8 @@
+Help for \ 2DELMASK\ 2:
+
+This command removes a mask added by ADDMASK.
+
+Syntax: DELMASK /<regex>/
+
+Examples:
+    /msg &nick& DELMASK /spambot$/
diff --git a/help/listmask b/help/listmask
new file mode 100644 (file)
index 0000000..6d43bce
--- /dev/null
@@ -0,0 +1,9 @@
+Help for \ 2LISTMASK\ 2:
+
+This command lists masks added by ADDMASK.
+
+Syntax: LISTMASK [<type>]
+
+Examples:
+    /msg &nick& LISTMASK
+    /msg &nick& LISTMASK exempt
diff --git a/help/setmask b/help/setmask
new file mode 100644 (file)
index 0000000..7865270
--- /dev/null
@@ -0,0 +1,12 @@
+Help for \ 2SETMASK\ 2:
+
+This command changes the type or expiry of a mask added
+with ADDMASK.
+
+See the ADDMASK help for details on the possible types.
+
+Syntax: SETMASK /<regex>/ <type|~expiry>
+
+Examples:
+    /msg &nick& SETMASK /spambot$/ lethal
+    /msg &nick& SETMASK /spambot$/ ~30m
diff --git a/masks.c b/masks.c
index 8afba644e83b1e2c0c23d5915ace21a7b6f2e8a6..f90b38355a2a4253eeeb62ad68934784a0af83d6 100644 (file)
--- a/masks.c
+++ b/masks.c
@@ -9,10 +9,10 @@ static void syn_cmd_delmask(sourceinfo_t *si, int parc, char **parv);
 static void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv);
 static void syn_cmd_listmask(sourceinfo_t *si, int parc, char **parv);
 
-command_t syn_addmask = { "ADDMASK", N_("Adds a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_addmask };
-command_t syn_delmask = { "DELMASK", N_("Removes a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_delmask };
-command_t syn_setmask = { "SETMASK", N_("Modifies settings for a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_setmask };
-command_t syn_listmask = { "LISTMASK", N_("Displays configured mask lists"), "syn:general", 1, syn_cmd_listmask };
+command_t syn_addmask = { "ADDMASK", N_("Adds a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_addmask, { .path = "syn/addmask" } };
+command_t syn_delmask = { "DELMASK", N_("Removes a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_delmask, { .path = "syn/delmask" } };
+command_t syn_setmask = { "SETMASK", N_("Modifies settings for a lethal, suspicious or exempt mask"), "syn:general", 1, syn_cmd_setmask, { .path = "syn/setmask" } };
+command_t syn_listmask = { "LISTMASK", N_("Displays configured mask lists"), "syn:general", 1, syn_cmd_listmask, { .path = "syn/listmask" } };
 
 static unsigned int lethal_mask_duration = 3600*24;
 static char *lethal_mask_message = NULL;