X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/d0f04f713ca0b689f745842fcc9e61d24610f11a..82089e3fd2b8c69de9286ff4d6cc9d845670ab7e:/src/mod-snoop.c diff --git a/src/mod-snoop.c b/src/mod-snoop.c index 2211472..fa067a4 100644 --- a/src/mod-snoop.c +++ b/src/mod-snoop.c @@ -5,7 +5,7 @@ * * x3 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -55,7 +55,11 @@ const char *snoop_module_deps[] = { NULL }; static int finalized; int snoop_finalize(void); -#define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS) +#if defined(GCC_VARMACROS) +# define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp, ARGS) +#elif defined(C99_VARMACROS) +# define SNOOP(FORMAT, ...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp, __VA_ARGS__) +#endif #define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now)) static void @@ -121,6 +125,9 @@ snoop_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) { if (user->uplink->burst && !snoop_cfg.show_bursts) return; if (user->handle_info) { UPDATE_TIMESTAMP(); + /* TODO: show old_handle info -> new handle info if they + * re-authed or something. + */ SNOOP("$bAUTH$b %s as %s", user->nick, user->handle_info->handle); } } @@ -240,6 +247,19 @@ snoop_channel_mode(struct userNode *who, struct chanNode *channel, char **modes, tg = tmp; break; } + case 'h': + { + strcat(targets, " "); + if ((tmp = strchr(tg, ' '))) + *tmp++ = 0; + if((un = GetUserN(tg))) + strcat(targets, un->nick); + else + strcat(targets, tg); + if(tmp) + tg = tmp; + break; + } case 'v': { strcat(targets, " ");