-/* event_neonspam_chanmsg.c - NeonServ v5.2
+/* event_neonspam_chanmsg.c - NeonServ v5.3
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
static void neonspam_event_chanmsg(struct UserNode *user, struct ChanNode *chan, char *message) {
struct ClientSocket *client = getChannelBot(chan, BOTID);
- if(!client) return; //we can't "see" this event
+ if(!client || (user->flags & USERFLAG_ISBOT)) return; //we can't "see" this event
loadNeonSpamSettings(chan);
struct NeonSpamSettings *settings = chan->spam_settings;
struct ChanUser *chanuser = getChanUser(user, chan);
char banmaskBuf[NICKLEN+USERLEN+HOSTLEN+3];
char *banmask = NULL;
switch (punishment) {
- case 3: //TIMEBAN: 1h
+ case 3: //TIMEBAN
banmask = generate_banmask(chanuser->user, banmaskBuf);
printf_mysql_query("INSERT INTO `bans` (`ban_channel`, `ban_mask`, `ban_triggered`, `ban_timeout`, `ban_owner`, `ban_reason`) VALUES ('%d', '%s', UNIX_TIMESTAMP(), '%lu', '%d', '%s')", chanuser->chan->channel_id, escape_string(banmask), (unsigned long) (punish_time ? (time(0) + punish_time) : 0), 0, escape_string(reason));
if(punish_time) {