#include <arpa/inet.h>
#endif
-extern time_t now;
static struct {
struct chanNode *channel;
struct userNode *bot;
int snoop_finalize(void);
#define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS)
-#define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now))
+#define UPDATE_TIMESTAMP() do { time_t feh = now; strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&feh)); } while (0)
static void
snoop_nick_change(struct userNode *user, const char *old_nick) {
}
static void
-snoop_part(struct userNode *user, struct chanNode *chan, const char *reason) {
+snoop_part(struct modeNode *mn, const char *reason) {
if (!snoop_cfg.enabled) return;
- if (user->dead) return;
+ if (mn->user->dead) return;
UPDATE_TIMESTAMP();
- SNOOP("$bPART$b %s by %s (%s)", chan->name, user->nick, reason ? reason : "");
+ SNOOP("$bPART$b %s by %s (%s)", mn->channel->name, mn->user->nick, reason ? reason : "");
}
static void
if (!snoop_cfg.enabled) return 0;
if (user->uplink->burst && !snoop_cfg.show_bursts) return 0;
UPDATE_TIMESTAMP();
- SNOOP("$bNICK$b %s %s@%s [%s] on %s", user->nick, user->ident, user->hostname, inet_ntoa(user->ip), user->uplink->name);
+ SNOOP("$bNICK$b %s %s@%s [%s] on %s", user->nick, user->ident, user->hostname, irc_ntoa(&user->ip), user->uplink->name);
return 0;
}
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_CHANOP;
- change.args[0].member = AddChannelUser(snoop_cfg.bot, snoop_cfg.channel);
+ change.args[0].u.member = AddChannelUser(snoop_cfg.bot, snoop_cfg.channel);
mod_chanmode_announce(snoop_cfg.bot, snoop_cfg.channel, &change);
return 1;
}