]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/mod-snoop.c
mod-python: improve error logic for pyobj_from_usernode
[irc/evilnet/x3.git] / src / mod-snoop.c
index 221147222f094e4d7184d0fee79d71caf38c088e..fa067a4565396ec9a8cd1191994eab0509871674 100644 (file)
@@ -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, " ");