]> jfr.im git - irc/quakenet/newserv.git/commitdiff
updated with latest helpmod2 changes from strutsi, v203 (20050528)
authorfroo <redacted>
Sun, 29 May 2005 07:43:00 +0000 (08:43 +0100)
committerfroo <redacted>
Sun, 29 May 2005 07:43:00 +0000 (08:43 +0100)
helpmod2/changelist
helpmod2/commands/checkchannel [new file with mode: 0644]
helpmod2/commands/message [new file with mode: 0644]
helpmod2/commands/termstats [new file with mode: 0644]
helpmod2/hcommands.c
helpmod2/helpmod.db.old
helpmod2/helpmod.h
helpmod2/hterm.c
helpmod2/hterm.h

index 77105a719804cd8d2dc3f0caeae01424bfa31983..3b30ce79abdac5255aa700541f0c875c0ccc1ab5 100644 (file)
@@ -204,3 +204,13 @@ Fixed some function calls to a more secure form
 Changed the ban system a bit, real host no longer preferred
 fixed G realname
 Fixed the annoying term bug
+
+2.03
+Fixed a bug in term finding
+Some code cleanup
+Added two new commands checkchannel and termstats
+Added a debug command for finding the annoying stats bug
+Banned users can no longer invite themselves to channels they're banned from
+Added a new command message and wrote command help for it
+Fixed a nasty bug concerning terms
+Fixed a minor bug in term listing
diff --git a/helpmod2/commands/checkchannel b/helpmod2/commands/checkchannel
new file mode 100644 (file)
index 0000000..89da3b3
--- /dev/null
@@ -0,0 +1,5 @@
+Syntax:  checkchannel [channel]
+Example: checkchannel #chan
+Lists some information on a channel.
+The information currently consists of the channel creation time and a list of users on the channel.
+As a security restriction, channels with opers on them can not be checked using this command.
diff --git a/helpmod2/commands/message b/helpmod2/commands/message
new file mode 100644 (file)
index 0000000..cf7d097
--- /dev/null
@@ -0,0 +1,3 @@
+Syntax:  message <channel> <message>
+Sends a message to the channel. The message sent is prefixed with your nick. 
+G must be on the channel the message is sent to.
\ No newline at end of file
diff --git a/helpmod2/commands/termstats b/helpmod2/commands/termstats
new file mode 100644 (file)
index 0000000..88bda73
--- /dev/null
@@ -0,0 +1,4 @@
+Syntax:  termstats [channel]
+Example: termstats #feds
+Lists term usage statistics for a channel.
+If no channel is defined then the statistics for global term usage is listed.
index ab88f2bed14e738467a0b5caea0971d517b3a709..86086b911c27927380ffec161e2a987829968703 100644 (file)
@@ -1,6 +1,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdio.h>
+#include <assert.h>
 
 #include "../nick/nick.h"
 #include "../channel/channel.h"
@@ -77,7 +78,7 @@ enum
     H_TERM_PLUS
 };
 
-void helpmod_cmd_addchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_addchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     if (argc == 0)
     {
@@ -104,7 +105,7 @@ void helpmod_cmd_addchan (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_delchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_delchan (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     char buffer[256];
@@ -126,7 +127,7 @@ void helpmod_cmd_delchan (huser *sender, channel* returntype, char* ostr, int ar
     helpmod_reply(sender, returntype, "Channel %s deleted succesfully", buffer);
 }   
 
-void helpmod_cmd_whoami (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_whoami (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     helpmod_reply(sender, returntype, "You are %s", sender->real_user->nick);
     helpmod_reply(sender, returntype, "Your userlevel is %s", hlevel_name(huser_get_level(sender)));
@@ -164,7 +165,7 @@ void helpmod_cmd_whoami (huser *sender, channel* returntype, char* ostr, int arg
     }
 }
 
-void helpmod_cmd_whois (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_whois (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     huser *husr;
     int i;
@@ -243,7 +244,7 @@ void helpmod_cmd_test (huser *sender, channel* returntype, char* ostr, int argc,
 }
 */
 
-void helpmod_cmd_seen (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_seen (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     huser *target_huser;
     haccount *target_haccount;
@@ -290,7 +291,7 @@ void helpmod_cmd_seen (huser *sender, channel* returntype, char* ostr, int argc,
     }
 }
 
-void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, channel* returntype, char* ostr, int argc, char *argv[])
 {
     huser *target_huser;
     haccount *target_haccount;
@@ -387,14 +388,14 @@ void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, channel* r
 }
 
 /* pseudo commands for the above */
-void helpmod_cmd_improper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_LAMER, returntype, ostr, argc, argv); }
-void helpmod_cmd_peon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_PEON, returntype, ostr, argc, argv); }
-void helpmod_cmd_trial (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_TRIAL, returntype, ostr, argc, argv); }
-void helpmod_cmd_staff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_STAFF, returntype, ostr, argc, argv); }
-void helpmod_cmd_oper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_OPER, returntype, ostr, argc, argv); }
-void helpmod_cmd_admin (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_ADMIN, returntype, ostr, argc, argv); }
-
-void helpmod_cmd_deluser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_improper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_LAMER, returntype, ostr, argc, argv); }
+static void helpmod_cmd_peon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_PEON, returntype, ostr, argc, argv); }
+static void helpmod_cmd_trial (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_TRIAL, returntype, ostr, argc, argv); }
+static void helpmod_cmd_staff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_STAFF, returntype, ostr, argc, argv); }
+static void helpmod_cmd_oper (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_OPER, returntype, ostr, argc, argv); }
+static void helpmod_cmd_admin (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_change_userlevel(sender, H_ADMIN, returntype, ostr, argc, argv); }
+
+static void helpmod_cmd_deluser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     int i;
     huser *target_huser;
@@ -444,7 +445,7 @@ void helpmod_cmd_deluser (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_listuser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_listuser (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     char *pattern;
     haccount *hack = haccounts;
@@ -484,7 +485,7 @@ void helpmod_cmd_listuser (huser *sender, channel* returntype, char* ostr, int a
         helpmod_reply(sender, returntype, "Accounts matching pattern %d", count);
 }
 
-void helpmod_cmd_censor (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_censor (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hcensor *hcens;
@@ -567,7 +568,7 @@ void helpmod_cmd_censor (huser *sender, channel* returntype, char* ostr, int arg
     }
 }
 
-void helpmod_cmd_chanconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     int old_flags=0;
@@ -638,7 +639,7 @@ void helpmod_cmd_chanconf (huser *sender, channel* returntype, char* ostr, int a
     }
 }
 
-void helpmod_cmd_acconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_acconf (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     haccount *hacc = sender->account;
 
@@ -702,7 +703,7 @@ void helpmod_cmd_acconf (huser *sender, channel* returntype, char* ostr, int arg
     }
 }
 
-void helpmod_cmd_welcome (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_welcome (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
 
@@ -727,7 +728,7 @@ void helpmod_cmd_welcome (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_aliases (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_aliases (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     char buf[512];
     int i = 0;
@@ -750,7 +751,7 @@ void helpmod_cmd_aliases (huser *sender, channel* returntype, char* ostr, int ar
        helpmod_reply(sender, returntype, "%s", buf);
 }
 
-void helpmod_cmd_showcommands (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_showcommands (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     int level = H_PEON;
     hcommand *tmp;
@@ -768,7 +769,7 @@ void helpmod_cmd_showcommands (huser *sender, channel* returntype, char* ostr, i
     return;
 }
 
-void helpmod_cmd_lamercontrol (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_lamercontrol (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hlc_profile *ptr;
@@ -813,7 +814,7 @@ void helpmod_cmd_lamercontrol (huser *sender, channel* returntype, char* ostr, i
 
 }
 
-void helpmod_cmd_term_find_general (huser *sender, channel* returntype, int type, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_general (huser *sender, channel* returntype, int type, char* ostr, int argc, char *argv[])
 {
     hterm *htrm;
     hterm *source;
@@ -897,22 +898,22 @@ void helpmod_cmd_term_find_general (huser *sender, channel* returntype, int type
         helpmod_reply(sender, returntype, "(%s): %s", htrm->name->content, htrm->description->content);
 }
 
-void helpmod_cmd_term_find (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     helpmod_cmd_term_find_general(sender, returntype, H_TERM_FIND, ostr, argc, argv);
 }
 
-void helpmod_cmd_term_find_minus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_minus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     helpmod_cmd_term_find_general(sender, returntype, H_TERM_MINUS, ostr, argc, argv);
 }
 
-void helpmod_cmd_term_find_plus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term_find_plus (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     helpmod_cmd_term_find_general(sender, returntype, H_TERM_PLUS, ostr, argc, argv);
 }
 
-void helpmod_cmd_klingon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_klingon (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     huser *target = NULL;
@@ -942,7 +943,7 @@ void helpmod_cmd_klingon (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hterm *htrm;
     hterm **source;
@@ -971,7 +972,7 @@ void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc,
         buffer[0] = '\0';
         htrm = *source;
 
-        if (argc > 2)
+        if (argc >= 2)
             pattern = argv[1];
         else
             pattern = "*";
@@ -1049,10 +1050,9 @@ void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc,
                 helpmod_reply(sender, returntype, "Can not delete term: Term %s not found", argv[i]);
                 continue;
             }
-            hterm_del(source, htrm);
+            hterm_del(source != NULL?source:&hterms, htrm);
             helpmod_reply(sender, returntype, "Term %s deleted succesfully", argv[i]);
         }
-
     }
     else if (!ci_strcmp(argv[0], "find"))
     {
@@ -1079,7 +1079,7 @@ void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc,
     }
 }
 
-void helpmod_cmd_queue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_queue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     int operation;
@@ -1118,7 +1118,7 @@ void helpmod_cmd_queue (huser *sender, channel* returntype, char* ostr, int argc
     helpmod_queue_handler(sender, returntype, hchan, operation, ostr, argc, argv);
 }
 
-void helpmod_cmd_done (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_done (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1126,7 +1126,7 @@ void helpmod_cmd_done (huser *sender, channel* returntype, char* ostr, int argc,
     helpmod_queue_handler(sender, returntype, hchan, HQ_DONE, ostr, argc, argv);
 }
 
-void helpmod_cmd_next (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_next (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1134,7 +1134,7 @@ void helpmod_cmd_next (huser *sender, channel* returntype, char* ostr, int argc,
     helpmod_queue_handler(sender, returntype, hchan, HQ_NEXT, ostr, argc, argv);
 }
 
-void helpmod_cmd_enqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_enqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1142,7 +1142,7 @@ void helpmod_cmd_enqueue (huser *sender, channel* returntype, char* ostr, int ar
     helpmod_queue_handler(sender, returntype, hchan, HQ_ON, ostr, argc, argv);
 }
 
-void helpmod_cmd_dequeue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_dequeue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1150,7 +1150,7 @@ void helpmod_cmd_dequeue (huser *sender, channel* returntype, char* ostr, int ar
     helpmod_queue_handler(sender, returntype, hchan, HQ_OFF, ostr, argc, argv);
 }
 
-void helpmod_cmd_autoqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_autoqueue (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1158,7 +1158,7 @@ void helpmod_cmd_autoqueue (huser *sender, channel* returntype, char* ostr, int
     helpmod_queue_handler(sender, returntype, hchan, HQ_MAINTAIN, ostr, argc, argv);
 }
 
-void helpmod_cmd_dnmo (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_dnmo (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     int i;
     if (argc == 0)
@@ -1195,7 +1195,7 @@ void helpmod_cmd_dnmo (huser *sender, channel* returntype, char* ostr, int argc,
     }
 }
 
-void helpmod_cmd_ban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_ban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     if (argc == 0)
     {
@@ -1285,7 +1285,7 @@ void helpmod_cmd_ban (huser *sender, channel* returntype, char* ostr, int argc,
     }
 }
 
-void helpmod_cmd_chanban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanban (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     int i;
@@ -1375,7 +1375,7 @@ void helpmod_cmd_chanban (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_idlekick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_idlekick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     int tmp;
@@ -1406,7 +1406,7 @@ void helpmod_cmd_idlekick (huser *sender, channel* returntype, char* ostr, int a
     }
 }
 
-void helpmod_cmd_topic (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_topic (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     DEFINE_HCHANNEL;
@@ -1505,7 +1505,7 @@ void helpmod_cmd_topic (huser *sender, channel* returntype, char* ostr, int argc
         helpmod_reply(sender, returntype, "Can not handle the topic of channel %s: Unknown operation %s", hchannel_get_name(hchan), argv[0]);
 }
 
-void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     huser *husr;
     int i;
@@ -1539,7 +1539,7 @@ void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int argc,
     }
 }
 
-void helpmod_cmd_everyoneout (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_everyoneout (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hchannel_user **hchanuser;
@@ -1584,7 +1584,7 @@ void helpmod_cmd_everyoneout (huser *sender, channel* returntype, char* ostr, in
     helpmod_reply(sender, returntype, "Channel %s has been cleared of normal users", hchannel_get_name(hchan));
 }
 
-void helpmod_cmd_kick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_kick (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     int i;
@@ -1640,7 +1640,7 @@ void helpmod_cmd_kick (huser *sender, channel* returntype, char* ostr, int argc,
         helpmod_kick(hchan, targets[i], reason);
 }
 
-void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     haccount *target = sender->account;
@@ -1764,7 +1764,7 @@ void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc
     }
 }
 
-void helpmod_cmd_chanstats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_chanstats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hstat_channel *channel_stats;
@@ -1862,7 +1862,7 @@ void helpmod_cmd_chanstats (huser *sender, channel* returntype, char* ostr, int
     }
 }
 
-void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hstat_accounts_array arr;
@@ -1924,7 +1924,7 @@ void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* ostr, in
     free(arr.array);
 }
 
-void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hstat_accounts_array arr;
@@ -1964,7 +1964,7 @@ void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, int argc
     free(arr.array);
 }
 
-void helpmod_cmd_report (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_report (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan, *target;
     DEFINE_HCHANNEL;
@@ -1999,7 +1999,7 @@ void helpmod_cmd_report (huser *sender, channel* returntype, char* ostr, int arg
     helpmod_reply(sender, returntype, "Channel %s is now reported to channel %s (%s)", hchannel_get_name(hchan), hchannel_get_name(hchan->report_to), hchannel_get_state(hchan, H_REPORT));
 }
 
-void helpmod_cmd_mode(huser *sender, channel* returntype, int change, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_mode(huser *sender, channel* returntype, int change, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     huser_channel *huserchan;
@@ -2132,12 +2132,12 @@ void helpmod_cmd_mode(huser *sender, channel* returntype, int change, char* ostr
     }
 }
 
-void helpmod_cmd_op (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_OP, ostr, argc, argv); }
-void helpmod_cmd_deop (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEOP, ostr, argc, argv); }
-void helpmod_cmd_voice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_VOICE, ostr, argc, argv); }
-void helpmod_cmd_devoice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEVOICE, ostr, argc, argv); }
+static void helpmod_cmd_op (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_OP, ostr, argc, argv); }
+static void helpmod_cmd_deop (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEOP, ostr, argc, argv); }
+static void helpmod_cmd_voice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_VOICE, ostr, argc, argv); }
+static void helpmod_cmd_devoice (huser *sender, channel* returntype, char* ostr, int argc, char *argv[]) { helpmod_cmd_mode(sender, returntype, H_CMD_DEVOICE, ostr, argc, argv); }
 
-void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
+static void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
 {
     hchannel *hchan;
     int i;
@@ -2164,16 +2164,21 @@ void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc
             return;
         }
         htick = hticket_get(sender->real_user->authname ,hchan);
+
         if (htick == NULL)
         {
             helpmod_reply(sender, returntype, "Can not invite: You do not have an invite ticket for channel %s", argv[0]);
             return;
         }
-        else
+
+        if (nickbanned(sender->real_user, hchan->real_channel))
         {
-            helpmod_invite(hchan, sender);
-            helpmod_reply(sender, returntype, "Invited you to channel %s", hchannel_get_name(hchan));
+            helpmod_reply(sender, returntype, "Can not invite: You are banned from channel channel %s", argv[0]);
+            return;
         }
+
+        helpmod_invite(hchan, sender);
+        helpmod_reply(sender, returntype, "Invited you to channel %s", hchannel_get_name(hchan));
         return;
     }
 
@@ -2203,7 +2208,7 @@ void helpmod_cmd_invite (huser *sender, channel *returntype, char* arg, int argc
     }
 }
 
-void helpmod_cmd_ticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_ticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     int expiration = HTICKET_EXPIRATION_TIME;
     hchannel *hchan;
@@ -2268,7 +2273,7 @@ void helpmod_cmd_ticket (huser *sender, channel* returntype, char* ostr, int arg
     helpmod_reply(husr, NULL, "You have been issued an invite ticket for channel %s. This ticket is valid for a period of %s. You can use my invite command to get to the channel now. Type /msg %s invite %s",hchannel_get_name(hchan), helpmod_strtime(HTICKET_EXPIRATION_TIME), helpmodnick->nick, hchannel_get_name(hchan));
 }
 
-void helpmod_cmd_resolve (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_resolve (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     int i;
     hchannel *hchan;
@@ -2326,7 +2331,7 @@ void helpmod_cmd_resolve (huser *sender, channel* returntype, char* ostr, int ar
     }
 }
 
-void helpmod_cmd_tickets (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_tickets (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     hticket *htick;
@@ -2364,7 +2369,7 @@ void helpmod_cmd_tickets (huser *sender, channel* returntype, char* ostr, int ar
     helpmod_reply(sender, returntype, "Done listing tickets. Channel %s had %d valid tickets", hchannel_get_name(hchan), i);
 }
 
-void helpmod_cmd_showticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+static void helpmod_cmd_showticket (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
 {
     hchannel *hchan;
     huser *husr;
@@ -2406,6 +2411,136 @@ void helpmod_cmd_showticket (huser *sender, channel* returntype, char* ostr, int
     }
 }
 
+static int helpmod_cmd_termstats_sort(const void *left, const void *right)
+{
+    return (*((hterm**)left))->usage - (*((hterm**)right))->usage;
+}
+
+static void helpmod_cmd_termstats(huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+    hterm **arr, *origin;
+    hchannel *hchan;
+    int i, count;
+
+    DEFINE_HCHANNEL;
+
+    if (hchan == NULL)
+        origin = hterms;
+    else
+        origin = hchan->channel_hterms;
+
+    count = hterm_count(origin);
+
+    if (count == 0)
+    {
+        helpmod_reply(sender, returntype, "Can not list term usage statistics: No terms available");
+        return;
+    }
+
+    arr = malloc(sizeof(hterm*) * count);
+    assert(arr != NULL);
+
+    for (i=0;i < count;i++,origin = origin->next)
+        arr[i] = origin;
+
+    qsort(arr, count, sizeof(hterm*), helpmod_cmd_termstats_sort);
+
+    if (hchan == NULL)
+        helpmod_reply(sender, returntype, "10 Most used global terms");
+    else
+        helpmod_reply(sender, returntype, "10 Most used terms for channel %s", hchannel_get_name(hchan));
+
+    for (i=0;i < 10 && i < count;i++)
+        helpmod_reply(sender, returntype, "#%02d %32s :%d",i, arr[i]->name->content,arr[i]->usage);
+
+    free(arr);
+}
+
+static void helpmod_cmd_checkchannel(huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+    channel *chan;
+    nick *nck;
+    int i;
+
+    if (argc == 0)
+    {
+        helpmod_reply(sender, returntype, "Can not check channel: Channel not defined");
+        return;
+    }
+
+    chan = findchannel(argv[0]);
+    if (chan == NULL)
+    {
+        helpmod_reply(sender, returntype, "Can not check channel: Channel %s not found", argv[0]);
+        return;
+    }
+    /* first pass */
+    for (i=0;i < chan->users->hashsize;i++)
+        {
+            nck = getnickbynumeric(chan->users->content[i]);
+            if (!nck) /* it's a hash, not an array */
+                continue;
+
+            if (IsOper(nck) && strlen(nck->nick) > 1)
+            {
+                helpmod_reply(sender, returntype, "Can not check channel: Permission denied. Channel %s has an oper on it", argv[0]);
+                return;
+            }
+        }
+
+    helpmod_reply(sender, returntype, "Information on channel %s", argv[0]);
+    helpmod_reply(sender, returntype, "Channel created %s ago", helpmod_strtime(time(NULL) - chan->timestamp));
+    /* second pass */
+    for (i=0;i < chan->users->hashsize;i++)
+        {
+            nck = getnickbynumeric(chan->users->content[i]);
+            char buf[256];
+            if (!nck) /* it's a hash, not an array */
+                continue;
+            helpmod_reply(sender, returntype, "%s", visiblehostmask(nck, buf));
+
+        }
+}
+
+static void helpmod_cmd_statsdebug (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+    haccount *hacc = haccounts;
+    hstat_account *ptr;
+    int i;
+
+    helpmod_reply(sender, returntype, "Account statistics");
+    for (;hacc;hacc = hacc->next)
+        for (ptr = hacc->stats;ptr;ptr = ptr->next)
+        {
+            helpmod_reply(sender, returntype, "Account %s channel %s short-term", hacc->name->content, hchannel_get_name(ptr->hchan));
+            for (i = 0;i < 7;i++)
+                helpmod_reply(sender, returntype, "%d %d %d %d", ptr->week[i].time_spent, ptr->week[i].prime_time_spent, ptr->week[i].lines, ptr->week[i].words);
+            helpmod_reply(sender, returntype, "Account %s channel %s long-term", hacc->name->content, hchannel_get_name(ptr->hchan));
+            for (i = 0;i < 10;i++)
+                helpmod_reply(sender, returntype, "%d %d %d %d", ptr->longterm[i].time_spent, ptr->longterm[i].prime_time_spent, ptr->longterm[i].lines, ptr->longterm[i].words);
+        }
+}
+
+static void helpmod_cmd_message (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
+{
+    hchannel *hchan;
+
+    if (argc < 2)
+    {
+        helpmod_reply(sender, returntype, "Can not send a message: Insufficient arguments");
+        return;
+    }
+    hchan = hchannel_get_by_name(argv[0]);
+    if (hchan == NULL)
+    {
+        helpmod_reply(sender, returntype, "Can not send a message: Invalid channel %s", argv[0]);
+        return;
+    }
+    SKIP_WORD;
+    helpmod_message_channel(hchan, "(%s) %s", sender->real_user->nick, ostr);
+    helpmod_reply(sender, returntype, "Message sent to %s", hchannel_get_name(hchan));
+}
+
 /* old H stuff */
 void helpmod_cmd_load (huser *sender, channel *returntype, char* arg, int argc, char *argv[])
 {
@@ -2628,6 +2763,10 @@ void hcommands_add(void)
     hcommand_add("tickets", H_STAFF, helpmod_cmd_tickets, "Lists all valid tickets for a channel");
     hcommand_add("showticket", H_STAFF, helpmod_cmd_showticket, "Shows the ticket for the user");
 
+    hcommand_add("termstats", H_OPER, helpmod_cmd_termstats, "Lists usage statistics for terms");
+    hcommand_add("checkchannel", H_STAFF, helpmod_cmd_checkchannel, "Shows channel information for any channel");
+    hcommand_add("statsdebug", H_ADMIN, helpmod_cmd_statsdebug, "Statistics debug command");
+    hcommand_add("message", H_TRIAL, helpmod_cmd_message, "Sends a message to a channel");
     /*hcommand_add("megod", H_PEON, helpmod_cmd_megod, "Gives you userlevel 4, if you see this in the final version, please kill strutsi");*/
     /*hcommand_add("test", H_PEON, helpmod_cmd_test, "Gives you userlevel 4, if you see this in the final version, please kill strutsi");*/
 }
index 1da2528fe4d8ec7796828cf7c0f89f12d0707590..35946e473193dd9c5e54816440bb77b0d8873bf1 100644 (file)
@@ -1,93 +1,87 @@
-% H2 version 2.01 database
-% Wed Feb 23 08:58:30 2005
+% H2 database, live Quakenet #feds version
+% A minimal start, can be used for a radical reset
 
-
-% lamercontrol profile structure:
-%  X (string):
-%  Y (string):
-%  Z (int):
 lamercontrol profile
-       nazi
-       25 10
-       1 4
-       3 4 4
-       3 0.010 7
-       0 1 2
-lamercontrol profile
-       strict
-       35 15
-       2 6
-       4 5 5
-       4 0.010 10
-       0 2 3
+       liberal
+        50 25
+        4 9
+        8 10 14
+        7 0.006 12
+        2 5 8
+        
 lamercontrol profile
        default
-       40 20
-       3 7
-       6 7 7
-       5 0.008 10
-       1 3 5
+        40 20
+        3 7
+        6 7 9
+        5 0.008 10
+        1 3 5
+        
 lamercontrol profile
-       liberal
-       50 25
-       4 9
-       8 10 10
-       7 0.006 12
-       2 5 8
-
-% channel structure:
-%  name (string):
-%  flags (integer):
-%  welcome message (string):
-%  lamercontrol profile (string):
+       strict
+        35 15
+        2 6
+        4 5 7
+        4 0.01 10
+        0 2 3
+        
+lamercontrol profile
+       nazi
+        25 10
+        1 4
+        3 4 5
+        3 0.01 7
+       0 1 2
+        
+% Initial channel (#feds), needed to have the terms for the channel
 channel
        #feds
-       8f03a
-       Welcome to #feds
-       default
-       0 % censor
-       17 % terms
-       takeover
-       Support for recovering stolen channels is limited as the responsibility for protecting those channels is your own. However, if you have not already done so, state the #channelname and be patient. If the operator informs you that he or she will not intervene in this case then there is no appeal and you should choose a new channel and consider what security mistakes you made which resulted in the loss of the original channel.
-       serverapp
-       You can find a server application at http://www.quakenet.org/server_application *READ IT CAREFULLY* Do not ask questions about the application form in #feds. Response time for submitted applications is typically between 2 to 4 weeks.
-       score
-       You must be in the top 5 recognised chanops to request L. Statistics for L are only recorded when you have op in the channel and there are at least 3 other people in the channel with you (who may or may not be channel ops). Previous op history is kept for approximately 10 days therefore it is possible for previous ops to have op time that greatly exceeds 2 hours, preventing you requesting L to a channel that appears unused. You will simply have to wait until the op time is exceeded or the records expire. 
-       stats
-       Please do not join #feds to question the statistical monitoring we carry out to check your L, Q or S request. Our services count according to internal rules designed to avoid network overload. Despite what you may perceive, services check these statistics much more accurately than you can. If you have failed in a request then you will simply have to try again in the future.
-       S
-       This is QuakeNet's antispam service. It can be requested from www.quakenet.org. Read the LFAQ on the site before requesting.
-       abuse
-       This channel can be used for reporting abusive users, not requesting specific punishment for the alleged crimes. Tell us where it is happening, and who is doing it, we will monitor the situation and decide how to deal with it. You may leave once the abuse has been reported. The decision of an operator is final.
-       removebot
-       Delete all CHANLEV's from the channel, and then L or Q will leave the channel. If the users are not online you will have to use their authname. Type ?? #auth for more.
-       logs
-       Log files cannot be taken as evidence by IRC operators in most situations, due to the ease with which they can be faked. As such, you should not attempt to send logs to an operator or paste large amounts of them into the channel unless asked to do so.
-       L 
-       QuakeNet's channel service L can be requested at www.quakenet.org, Read the LFAQ on the site before requesting.
-       ircops
-       IRC Operators of QuakeNet are volunteers. They do not get paid for their work, and often contribute out of their own pocket towards QuakeNet`s costs. Most of the IRC Operators have ordinary work to attend to at day and/or night time, families etc. The IRC Operators of QuakeNet are NOT required or obligated to help users at any time.
-       IPv6
-       QuakeNet does not support IPv6, and there are no plans to support IPV6 in the near future 
-       gaveowner
-       If you give another user the +n chanlev on Q or L, this user is then allowed to take away your own +n. It does not matter who originally requested the service. For this reason, you should exercise extreme caution when setting the owner on users in channels you currently control.
-       freeop 
-       Operator help for takeovers on freeop channels is not available. If you want support in protecting your channel then use the channel modes and chanlevs wisely and use them to manage your channel, not to win friends and influence.
-       business
-       QuakeNet does NOT offer any additional support to users wishing to operate, or propogate, a business on our servers. If you wish to do so in spite of this, you will NOT recieve support from our staff, and will be dealt with like any other user on the network. All business activities which make use of QuakeNet resources are at your own risk and QuakeNet in no way guarantees or warrants that a service available currently will be available on a continued basis.
-       eggdrop
-       We do not provide help with other people`s bots/eggdrops. see the bot administrator for help (a /whois of the bot will often provide information on where to find the administrator).
-       question 
-       State your question. Do not ask if you can ask a question, or if particular staff are available. Do not use 1 word per line when stating your question, and if it is about a channel, provide the #channel name. Do not paste logs or other large text items in the channel.
+       F03A
+        Welcome to #feds
+        default
+        0 % censor
+        17 % terms 17 total
        #feds
        This channel is for matters REQUIRING the assistance of an IRC operator. Questions answered in the FAQs, or that do not require an IRC operator, will be ignored. Read the FAQs at www.quakenet.org, and if that does not help, visit #help.
+       question 
+       State your question. Do not ask if you can ask a question, or if particular staff are available. Do not use 1 word per line when stating your question, and if it is about a channel, provide the #channel name. Do not paste logs or other large text items in the channel.
+       eggdrop
+       We do not provide help with other people`s bots/eggdrops. see the bot administrator for help (a /whois of the bot will often provide information on where to find the administrator).
+       business
+       QuakeNet does NOT offer any additional support to users wishing to operate, or propogate, a business on our servers. If you wish to do so in spite of this, you will NOT recieve support from our staff, and will be dealt with like any other user on the network. All business activities which make use of QuakeNet resources are at your own risk and QuakeNet in no way guarantees or warrants that a service available currently will be available on a continued basis.
+       freeop 
+       Operator help for takeovers on freeop channels is not available. If you want support in protecting your channel then use the channel modes and chanlevs wisely and use them to manage your channel, not to win friends and influence.
+       gaveowner
+       If you give another user the +n chanlev on Q or L, this user is then allowed to take away your own +n. It does not matter who originally requested the service. For this reason, you should exercise extreme caution when setting the owner on users in channels you currently control.
+       IPv6
+       QuakeNet does not support IPv6, and there are no plans to support IPV6 in the near future 
+       ircops
+       IRC Operators of QuakeNet are volunteers. They do not get paid for their work, and often contribute out of their own pocket towards QuakeNet`s costs. Most of the IRC Operators have ordinary work to attend to at day and/or night time, families etc. The IRC Operators of QuakeNet are NOT required or obligated to help users at any time.
+       L 
+       QuakeNet's channel service L can be requested at www.quakenet.org, Read the LFAQ on the site before requesting.
+       logs
+       Log files cannot be taken as evidence by IRC operators in most situations, due to the ease with which they can be faked. As such, you should not attempt to send logs to an operator or paste large amounts of them into the channel unless asked to do so.
+       removebot
+       Delete all CHANLEV's from the channel, and then L or Q will leave the channel. If the users are not online you will have to use their authname. Type ?? #auth for more.
+       abuse
+       This channel can be used for reporting abusive users, not requesting specific punishment for the alleged crimes. Tell us where it is happening, and who is doing it, we will monitor the situation and decide how to deal with it. You may leave once the abuse has been reported. The decision of an operator is final.
+       S
+       This is QuakeNet's antispam service. It can be requested from www.quakenet.org. Read the LFAQ on the site before requesting.
+       stats
+       Please do not join #feds to question the statistical monitoring we carry out to check your L, Q or S request. Our services count according to internal rules designed to avoid network overload. Despite what you may perceive, services check these statistics much more accurately than you can. If you have failed in a request then you will simply have to try again in the future.
+       score
+       You must be in the top 5 recognised chanops to request L. Statistics for L are only recorded when you have op in the channel and there are at least 3 other people in the channel with you (who may or may not be channel ops). Previous op history is kept for approximately 10 days therefore it is possible for previous ops to have op time that greatly exceeds 2 hours, preventing you requesting L to a channel that appears unused. You will simply have to wait until the op time is exceeded or the records expire. 
+       serverapp
+       You can find a server application at http://www.quakenet.org/server_application *READ IT CAREFULLY* Do not ask questions about the application form in #feds. Response time for submitted applications is typically between 2 to 4 weeks.
+       takeover
+       Support for recovering stolen channels is limited as the responsibility for protecting those channels is your own. However, if you have not already done so, state the #channelname and be patient. If the operator informs you that he or she will not intervene in this case then there is no appeal and you should choose a new channel and consider what security mistakes you made which resulted in the loss of the original channel.
+        0 0 0 0 0 0
+       0 0 0 0 0 0
        0 0 0 0 0 0
        0 0 0 0 0 0
        0 0 0 0 0 0
        0 0 0 0 0 0
-       0 0 3 0 0 0
        0 0 0 0 0 0
-       0 0 1 0 0 0
        0 0 0 0 0 0
        0 0 0 0 0 0
        0 0 0 0 0 0
@@ -99,89 +93,51 @@ channel
        0 0 0 0 0 0
        0 0 0 0 0 0
 
-
-% account structure:
-%  name (string):
-%  level (integer):
-account
-       minimoo
-       4       0
-       0 % statistics for this channel
+% Initial account (mine)
 account
-       Deckard
-       4       0
-       0 % statistics for this channel
-account
-       Salt
-       4       0
-       0 % statistics for this channel
-account
-       rnikkila
+       strutsi
        5       0
-       0 % statistics for this channel
-
+        0
 
-% ban structure:
-%  banmask (string):
-%  reason (string):
-%  expiration (int):
-
-% term structure:
-%  name (string):
-%  description (string):
 term
-       password
-       If you have forgotten your auth password use /msg q requestpassword. If you have not set your email address then the auth account is lost - an oper will NOT tell you the password for any auth account. Accounts that formely had owner on a channel will expire in 40 days at which point the next highest chanlev in the channel may use /MSG L (or Q) REQUESTOWNER. 
-term
-       P
-       All clients are scanned upon connection for open proxies. That means that the service tries to connect to the user`s computer, and if successful, try to connect back to QuakeNet, through the proxy. If successful with that, the user gets a temporary ban from QuakeNet. It is up to the user to secure his or her computer. The action of connecting to QuakeNet indicates your acceptance of this security test.
+       #auth
+       If the user is not online at the moment you can still modify his/her account by using the user's auth nick and putting # infront of it (If user John have auth Clan^John it would be #Clan^John). You can list the auth nicks by doing /msg Q chanlev #channel or /msg L chanlev #channel.
 term
-       requestop
-       You can use /msg o requestop #channel to request channel operator status in a channel that has no ops. This command will not work during a netsplit, or if you are not a recognised chanop. If you cannot get op in a channel then an operator will not assist you.
+       authsecure 
+       If you are concerned that your auth account is compromised first do /MSG Q WHOIS #authname. If you are the only person authed to the account do /MSG Q WHOAMI and check the email address listed is yours (check it is EXACTLY your email address). If it is incorrect, change it with the EMAIL command. Following this you should use /MSG Q NEWPASS to change the current password. 
 term
-       nickserv
-       QuakeNet does not use Nickserv to reserve nicknames. As a result of this, you cannot register your nickname on QuakeNet. If a nickname is available, any user is allowed to use it. However, this does NOT apply to the nicknames of IRC Operators, Helpers and Network services, due to security related issues. If a user uses any of these nicknames, an operator may immediately disconnect the user from the network WITHOUT prior notice.
+       authhack
+       Auth accounts are not 'hacked'. Poor security on your computer, using a compromised/free BNC, messaging your auth details to someone other than Q, clicking URLs pasted in channels and running decode scripts and commands without understanding beforehand what they do is the cause of lost auths. If you want help you will have to identify HOW your auth was compromised first.
 term
-       netrider
-       If you create a channel during a netsplit which exists on the other side of the split and has +i or +k set, then you will be automatically kicked off the channel when the net rejoins with the kick message 'NetRider'. 
+       FAQ
+       QuakeNet FAQs can be found at www.quakenet.org. These contain information on security, channel and user modes, IRCing, channel services and our network rules.
 term
-       expire
-       An unused L bot will expire from a channel after 20 days of inactivity (No known users joining), or if the channel usercount is insufficient over a period of time. A Q bot will expire after 40 days of inactivity. You will need to request L into the channel again if you wish to secure it. These unused services are removed during a cleanup process which typically takes place every 40 days, but may on occasion occur later.
+       modes
+       QuakeNet channels have a number of channel and user modes to provide protection against harrasment, advertising and other unwelcome behaviour, and to help you manage your channel. Visit www.quakenet.org and read the IRC FAQ for a full list of the current modes.
 term
-       fixtakeover
-       Use /msg L (or Q) recover #channel to recover your channel. This command requires at least +m in your chanlev. If you are +ao only you can /msg L (or Q) invite #channel to enter the channel and remove channel modes manually. Note that if a Q ban has been set on you the invite command will not be effective.
+       chanserv
+       You can not register channels on QuakeNet. Instead, you can request the channel service bot called 'L' to join your channel. You will first need an auth account, and then you can request the L bot using that auth account. Visit www.quakenet.org and read the General FAQ for details of auth accounts, and the L FAQ for details of the L bot.
 term
        fishbot
        Fishbot exists to remind our users that fish do indeed go m00! To get fishbot in your channel, do /invite fishbot #channel. To remove fishbot from your channel, just kick it. Fishbot has NO other purpose and is not part of some secret, evil conspiracy. 
 term
-       chanserv
-       You can not register channels on QuakeNet. Instead, you can request the channel service bot called 'L' to join your channel. You will first need an auth account, and then you can request the L bot using that auth account. Visit www.quakenet.org and read the General FAQ for details of auth accounts, and the L FAQ for details of the L bot.
+       fixtakeover
+       Use /msg L (or Q) recover #channel to recover your channel. This command requires at least +m in your chanlev. If you are +ao only you can /msg L (or Q) invite #channel to enter the channel and remove channel modes manually. Note that if a Q ban has been set on you the invite command will not be effective.
 term
-       modes
-       QuakeNet channels have a number of channel and user modes to provide protection against harrasment, advertising and other unwelcome behaviour, and to help you manage your channel. Visit www.quakenet.org and read the IRC FAQ for a full list of the current modes.
+       expire
+       An unused L bot will expire from a channel after 20 days of inactivity (No known users joining), or if the channel usercount is insufficient over a period of time. A Q bot will expire after 40 days of inactivity. You will need to request L into the channel again if you wish to secure it. These unused services are removed during a cleanup process which typically takes place every 40 days, but may on occasion occur later.
 term
-       FAQ
-       QuakeNet FAQs can be found at www.quakenet.org. These contain information on security, channel and user modes, IRCing, channel services and our network rules.
+       netrider
+       If you create a channel during a netsplit which exists on the other side of the split and has +i or +k set, then you will be automatically kicked off the channel when the net rejoins with the kick message 'NetRider'. 
 term
-       authhack
-       Auth accounts are not 'hacked'. Poor security on your computer, using a compromised/free BNC, messaging your auth details to someone other than Q, clicking URLs pasted in channels and running decode scripts and commands without understanding beforehand what they do is the cause of lost auths. If you want help you will have to identify HOW your auth was compromised first.
+       nickserv
+       QuakeNet does not use Nickserv to reserve nicknames. As a result of this, you cannot register your nickname on QuakeNet. If a nickname is available, any user is allowed to use it. However, this does NOT apply to the nicknames of IRC Operators, Helpers and Network services, due to security related issues. If a user uses any of these nicknames, an operator may immediately disconnect the user from the network WITHOUT prior notice.
 term
-       authsecure 
-       If you are concerned that your auth account is compromised first do /MSG Q WHOIS #authname. If you are the only person authed to the account do /MSG Q WHOAMI and check the email address listed is yours (check it is EXACTLY your email address). If it is incorrect, change it with the EMAIL command. Following this you should use /MSG Q NEWPASS to change the current password. 
+       requestop
+       You can use /msg o requestop #channel to request channel operator status in a channel that has no ops. This command will not work during a netsplit, or if you are not a recognised chanop. If you cannot get op in a channel then an operator will not assist you.
 term
-       #auth
-       If the user is not online at the moment you can still modify his/her account by using the user's auth nick and putting # infront of it (If user John have auth Clan^John it would be #Clan^John). You can list the auth nicks by doing /msg Q chanlev #channel or /msg L chanlev #channel.
-
-% ticket structure:
-%  channel (string)
-%  authname (string)
-%  expiration time (int)
-
-% report structure:
-%  channel reported
-%  channel reported to
-
-% global variables
-%  hstat_cycle
-globals
-       3
+       P
+       All clients are scanned upon connection for open proxies. That means that the service tries to connect to the user`s computer, and if successful, try to connect back to QuakeNet, through the proxy. If successful with that, the user gets a temporary ban from QuakeNet. It is up to the user to secure his or her computer. The action of connecting to QuakeNet indicates your acceptance of this security test.
+term
+       password
+       If you have forgotten your auth password use /msg q requestpassword. If you have not set your email address then the auth account is lost - an oper will NOT tell you the password for any auth account. Accounts that formely had owner on a channel will expire in 40 days at which point the next highest chanlev in the channel may use /MSG L (or Q) REQUESTOWNER. 
index 4f81073b08c30db1f021abe388315d7d3e57f2e3..842602842a4bed0919c24cdb6d7b590303dd82d2 100644 (file)
@@ -10,7 +10,7 @@
 
 /* configuration */
 
-#define HELPMOD_VERSION "2.02"
+#define HELPMOD_VERSION "2.03"
 
 #define HELPMOD_USER_TIMEOUT 1200
 
index 937165075a41f3d09b3b3cb8f91f8fe77a823524..1270c8415bdfa62f0f8969e22554a934163d055a 100644 (file)
@@ -18,9 +18,10 @@ hterm *hterm_add(hterm** ptr, const char *name, const char *desc)
     if (name == NULL || desc == NULL || hterm_get(*ptr, name))
         return NULL;
 
-    htrm = (hterm*)malloc(sizeof(htrm));
+    htrm = (hterm*)malloc(sizeof(hterm));
     htrm->name = getsstring(name, strlen(name));
     htrm->description = getsstring(desc, strlen(desc));
+    htrm->usage = 0;
 
     htrm->next = *ptr;
     *ptr = htrm;
@@ -30,18 +31,12 @@ hterm *hterm_add(hterm** ptr, const char *name, const char *desc)
 
 hterm *hterm_get(hterm *source, const char *str)
 {
-    hterm *ptr;
-    if (source == NULL)
-        ptr = hterms;
-    else
-        ptr = source;
+    hterm *ptr = source;
+
     for (;ptr;ptr = ptr->next)
         if (!ci_strcmp(ptr->name->content, str))
             return ptr;
-    if (source != NULL)
-        return hterm_get(NULL, str);
-    else
-        return NULL;
+    return NULL;
 }
 
 hterm *hterm_find(hterm *source, const char *str)
@@ -49,9 +44,6 @@ hterm *hterm_find(hterm *source, const char *str)
     hterm *ptr;
     char buffer[512];
 
-    if (source == NULL)
-        source = hterms;
-
     sprintf(buffer, "*%s*", str);
 
     for (ptr = source;ptr;ptr = ptr->next)
@@ -60,30 +52,23 @@ hterm *hterm_find(hterm *source, const char *str)
     for (ptr = source;ptr;ptr = ptr->next)
         if (strregexp(ptr->description->content, buffer))
             return ptr;
-    if (source == NULL)
-        return hterm_find(NULL, str);
-    else
-        return NULL;
+    return NULL;
 }
 
 hterm *hterm_get_and_find(hterm *source, const char *str)
 {
-    /*hterm *ptr = hterm_get(source, str);
-    if (ptr == NULL)
-        ptr = hterm_find(source, str);
-        return ptr;*/
-    /* search order: get source, get NULL, find source, find NULL */
+    /* search order: get source, get hterms, find source, find hterms */
     hterm *ptr;
     ptr = hterm_get(source, str);
     if (ptr != NULL)
         return ptr;
-    ptr = hterm_get(NULL, str);
+    ptr = hterm_get(hterms, str);
     if (ptr != NULL)
         return ptr;
     ptr = hterm_find(source, str);
     if (ptr != NULL)
         return ptr;
-    ptr = hterm_find(NULL, str);
+    ptr = hterm_find(hterms, str);
     return ptr;
 }
 
@@ -91,9 +76,6 @@ hterm *hterm_del(hterm** start, hterm *htrm)
 {
     hterm** ptr = start;
 
-    if (start == NULL)
-        ptr = &hterms;
-
     for (;*ptr;ptr = &(*ptr)->next)
         if (*ptr == htrm)
         {
@@ -106,10 +88,7 @@ hterm *hterm_del(hterm** start, hterm *htrm)
             return NULL;
         }
 
-    if (start != NULL)
-        return hterm_del(NULL, htrm);
-    else
-        return htrm;
+    return htrm;
 }
 
 void hterm_del_all(hterm **source)
index 985840a3d15ea71c4dae55618114e5e3c449572b..c79325cdef1c49498ab36bdc2147a1ec6d5112f8 100644 (file)
@@ -9,6 +9,8 @@ typedef struct hterm_struct
     sstring *name;
     sstring *description;
 
+    int usage;
+
     struct hterm_struct *next;
 } hterm;