X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/776274613f4ace06be5b240c69292bc8729f5c00..3b7fa78b1de8f9ee8718cba3da3b2db522b70620:/src/mod-snoop.c diff --git a/src/mod-snoop.c b/src/mod-snoop.c index f574861..fa067a4 100644 --- a/src/mod-snoop.c +++ b/src/mod-snoop.c @@ -3,9 +3,9 @@ * * This file is part of x3. * - * srvx is free software; you can redistribute it and/or modify + * 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, " ");