#include <ctype.h>
#include <stdlib.h>
-#include "../nick/nick.h"
-
#include "huser.h"
#include "hban.h"
#include "hchannel.h"
int caps = 0;
int noncaps = 0;
int i;
+ int firstword;
+
+ if (strchr(line, ' '))
+ firstword = strchr(line, ' ') - line;
+ else
+ firstword = 0;
/* Handle the thing sent with /me */
- if (!strncmp(line, "\0x01ACTION", 6 + 1))
- line+=(6 + 1);
+ if (!strncmp(line, "\1ACTION", 6 + 1))
+ line+=(6 + 1);
+ else if (firstword && firstword < NICKLEN + 3)
+ {
+ char buffer[NICKLEN + 3];
+ strncpy(buffer, line, firstword);
+ buffer[firstword] = '\0';
+ if (buffer[firstword - 1] == ':')
+ buffer[firstword - 1] = '\0';
+ if (getnickbynick(buffer))
+ line+=firstword + 1;
+ }
for (i = 0;line[i];i++)
{
{
char chr = '\0';
int i;
- int repeats;
+ int repeats = 0;
for (i = 0;line[i];i++)
if (line[i] == chr)
static int hlc_check_spam(hlc_profile *hlc_prof, huser *husr, const char *line)
{
- if (husr->spam_val < (float)time(NULL))
- husr->spam_val = (float)time(NULL);
+ if (husr->spam_val < (double)time(NULL))
+ husr->spam_val = (double)time(NULL);
- husr->spam_val += (hlc_prof->constant_spam * (double)strlen(line));
+ husr->spam_val += ((double)(hlc_prof->constant_spam) * (double)strlen(line));
- if (((int)husr->spam_val - time(NULL)) >= (hlc_prof->tolerance_spam))
+ if (((int)(husr->spam_val) - time(NULL)) >= (hlc_prof->tolerance_spam))
{
husr->spam_val = time(NULL);
return ++husr->lc[HLC_SPAM];
return "Error, please contact strutsi";
}
}
-