fixes for the last commits (buildable now)
authorpk910 <philipp@zoelle1.de>
Thu, 7 Jul 2011 19:32:22 +0000 (21:32 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 7 Jul 2011 19:53:42 +0000 (21:53 +0200)
src/chanserv.c
src/spamserv.c
src/spamserv.help [new file with mode: 0644]

index 0e8aeee4d3f59abbd73d15092b10a0e7c0821879..e968d6338513c54263c0bc63ff6c9a938e6b2381 100644 (file)
@@ -713,6 +713,7 @@ static unsigned int userCount;
 
 #define GetChannelAccess(channel, handle) _GetChannelUser(channel, handle, 0, 0)
 #define GetTrueChannelAccess(channel, handle) _GetChannelUser(channel, handle, 0, 1)
+static void unregister_channel(struct chanData *channel, const char *reason);
 
 unsigned short
 user_level_from_name(const char *name, unsigned short clamp_level)
@@ -6621,7 +6622,7 @@ static CHANSERV_FUNC(cmd_vote)
     struct userData *target;
     struct handle_info *hi;
     unsigned int votedfor = 0;
-    char *votedfor_str;
+    char *votedfor_str = NULL;
     
     if (!cData || !cData->vote) {
         reply("CSMSG_NO_VOTE");
@@ -6726,6 +6727,7 @@ static CHANSERV_FUNC(cmd_startvote)
     irc_privmsg(cmd->parent->bot, channel->name, response);
     sprintf(response, user_find_message(user, "CSMSG_STARTVOTE_HOWTO")); //Todo
     irc_privmsg(cmd->parent->bot, channel->name, response);
+    return 1;
 }
 
 static CHANSERV_FUNC(cmd_endvote)
@@ -7016,6 +7018,7 @@ handle_join(struct modeNode *mNode)
     struct handle_info *handle;
     unsigned int modes = 0, info = 0;
     char *greeting;
+    unsigned int i = 0;
 
     if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info))
         return 0;
index 8eb84f7aceba9f9d2357c28a60873a6f441ecc31..35cf836afaa72cf0864ddcd3fd8de0f67603439b 100644 (file)
@@ -513,13 +513,11 @@ spamserv_delete_user(struct userInfo *uInfo)
        free(uInfo);
 }
 
-static int
+static void
 spamserv_new_user_func(struct userNode *user)
 {
        if(!IsLocal(user))
                spamserv_create_user(user);
-  
-       return 0;
 }
 
 static void
@@ -1805,7 +1803,7 @@ spamserv_channel_message(struct chanNode *channel, struct userNode *user, char *
                int size = strlen(user->hostname) + 3;
                char *mask = alloca(size);
                snprintf(mask, size, "*@%s", user->hostname);
-               gline_add(spamserv->nick, mask, spamserv_conf.gline_duration, reason, now, now, 1);
+               gline_add(spamserv->nick, mask, spamserv_conf.gline_duration, reason, now, now, 0, 1);
                spamserv_debug(SSMSG_DEBUG_GLINE, user->nick, user->hostname, channel->name);
        }
        else if(CHECK_KILL(uInfo))
diff --git a/src/spamserv.help b/src/spamserv.help
new file mode 100644 (file)
index 0000000..23ee5ce
--- /dev/null
@@ -0,0 +1,91 @@
+"<INDEX>" ("$b$X Help$b",
+        "The $b$X$b service checks the channel for spam, flood, joinflood and disallowed advertisements.",
+        "$bUser Commands:$b",
+        "  ADDEXCEPTION  Adds a word to the exception list.",
+        "  DELEXCEPTION  Deletes a word from the exception list.",
+        "  SET           Changes various channel settings.",
+        "  STATUS        Shows general information about $X.",
+        "  VERSION       Prints the srvx and $X version information.",
+        "$bStaff Commands:$b",
+        "  REGISTER      Registers a new channel.",
+        "  UNREGISTER    Removes $X from a registered channel.");
+"ADDEXCEPTION" ("/msg $X ADDEXCEPTION [word]",
+        "Without an argument, it will show all existing exceptions.",
+         "With an argument, it will add the given word to the exception list.",
+         "$X checks, if one of the words in the sentence of a user is in the exception list; if so, $X will not punish the user, doesn't matter, if it's a bad advertisement.",
+         "This means, you have to make sure, all exceptions are adequate.",
+         "$bFirst example$b: You added the word \"gamesurge.net\" to the exception list and someone posts \"www.gamesurge.net/aup\", he won't get punished.",
+         "$bSecond example$b: You added the word \"support\" to the list and someone tells another person to join #support, he won't get punished.",
+         "$bThird example$b: You added \"GameSurge\" to the list and someone posts \"JOIN #channelxyz on GameSurge\", he will NOT get punished, because the word \"GameSurge\" is in the sentence.",
+         "If he would say \"JOIN #channelxyz\", $X would punish him.",
+         "$uSee Also:$u delexception");
+"DELEXCEPTION" ("/msg $X DELEXCEPTION",
+        "Without an argument, it will show all existing exceptions.",
+        "With an argument, it will delete the given word from the exception list.",
+        "$uSee Also:$u addexception");
+"SET" ("/msg $X SET <#channel> [<parameter> [setting]]",
+        "This command will set various channel options. With no arguments, it will show the current values of all channel options.",
+        "Only channel owners and coowners may change settings.",
+        "SPAMLIMIT:      Number of equal lines, a user may send.",
+        "ADVREACTION:    What happens when someone advertises after warning.",
+        "WARNREACTION:   What happens when someone continues spamming/flooding after warning.",
+        "ADVSCAN:        Enables/Disables scanning for advertisements.",
+        "SPAMSCAN:       Enables/Disables scanning for spam.",
+        "FLOODSCAN:      Enables/Disables scanning for flood.",
+        "JOINFLOODSCAN:  Enables/Disables scanning for joinflood.",
+        "SCANCHANOPS:    Indicates whether $X has to scan messages from channel ops.",
+        "SCANVOICED:     Indicates whether $X has to scan messages from voiced users.",
+        "$uSee Also:$u set spamlimit, set advreaction, set warnreaction, set advscan, set spamscan, set floodscan, set joinfloodscan, set scanchanops, set scanvoiced");
+"SET SPAMLIMIT" ("/msg $X SET <#channel> SPAMLIMIT <value>",
+        "You can specify the number of equal messages, a user may send.  Valid settings are:",
+        "$b0$b  Users may send the same message $b2$b times.",
+        "$b1$b  Users may send the same message $b3$b times.",
+        "$b2$b  Users may send the same message $b4$b times.",
+        "$b3$b  Users may send the same message $b5$b times.",
+        "$b4$b  Users may send the same message $b6$b times.",
+        "$uSee Also:$u set spamscan");
+"SET ADVREACTION" ("/msg $X SET <#channel> ADVREACTION <value>",
+        "This setting controls what happens to those who send disallowed advertisements to the channel after a warning:",
+        "$b0$b  Kick on disallowed advertising.",
+        "$b1$b  Kickban on disallowed advertising.",
+        "$b2$b  Short timed ban (default: 15 minutes) on disallowed advertising.",
+        "$b3$b  Long timed ban (default: 1 hour) on disallowed advertising.",
+        "$b4$b  Kill on disallowed advertising. Only settable by irc operators.",
+        "$uSee Also:$u set advscan");
+"SET WARNREACTION" ("/msg $X SET <#channel> WARNREACTION <value>",
+        "This setting controls what happens to those who spam or flood the channel after a warning:",
+        "$b0$b  Kick after warning.",
+        "$b1$b  Kickban after warning.",
+        "$b2$b  Short timed ban (default: 15 minutes) after warning.",
+        "$b3$b  Long timed ban (default: 1 hour) after warning.",
+        "$b4$b  Kill after warning. Only settable by irc operators.",
+        "$uSee Also:$u set spamscan, set floodscan");
+"SET ADVSCAN" ("/msg $X SET <#channel> ADVSCAN <1/0>",
+        "If this setting is enabled, $X checks all messages for advertisements.",
+        "Advertisements are: www.*, http:*, ftp.*, ftp:* and #*; e.g. #srvx, http://www.srvx.net etc ..");
+"SET SPAMSCAN" ("/msg $X SET <#channel> SPAMSCAN <1/0>",
+        "If this setting is enabled, $X checks all incoming channel messages for spam.",
+        "Posting the same message multiple times is considered as spam, which means, if someone posts the same message more than the number of times, which is allowed (/msg $X set SPAMLIMIT), $X will punish him.");
+"SET FLOODSCAN" ("/msg $X SET <#channel> FLOODSCAN <1/0>",
+        "If this setting is enabled, $X checks, if a person tries to flood the channel.",
+        "Posting messages in a small amount of time is considered as flood, so if someone tries to flood the channel, $X will punish him.");
+"SET JOINFLOODSCAN" ("/msg $X SET <#channel> JOINFLOODSCAN <1/0>",
+        "If this setting is enabled, $X checks, if a person joins the channel more than one time.",
+        "Normally users join a channel and stay in the channel or part and do not rejoin after a few seconds.",
+        "If they want to cause trouble, they join/part the channel very often. $X will punish every user, who does that.");
+"SET SCANCHANOPS" ("/msg $X SET <#channel> SCANCHANOPS <1/0>",
+        "If this setting is disabled, $X doesn't check messages from oped users for spam, flood and advertisements.");
+"SET SCANVOICED" ("/msg $X SET <#channel> SCANVOICED <1/0>",
+        "If this setting is disabled, $X doesn't check messages from voiced users for spam, flood and advertisements.");
+"REGISTER" ("/msg $X REGISTER <#channel>",
+        "Registers a channel with $X.",
+        "The Channel must be registered with $C and may not be suspended.",
+        "$uSee Also:$u unregister");
+"STATUS" ("/msg $X STATUS [MEMORY|CHANNELS]",
+        "$bSTATUS$b shows you general information about $X. An irc operator can get information about the memory usage and a list of all registered channels.");
+"UNREGISTER" ("/msg $X UNREGISTER <#channel> [CONFIRM]",
+        "Removes $X from the given channel.",
+        "If you are not network staff, you must add $bCONFIRM$b to the end of your line to confirm unregistration.",
+        "$bSee Also:$b register");
+"VERSION" ("/msg $X VERSION",
+        "$bVERSION$b causes $X to send you the srvx version and some additional version information about $X.");
\ No newline at end of file