Explorar el Código

* Don't relay hub's timestamp out to other hubs

Bryan Drewery hace 16 años
padre
commit
0321e61f16
Se han modificado 3 ficheros con 6 adiciones y 1 borrados
  1. 1 0
      doc/UPDATES
  2. 2 1
      src/botmsg.c
  3. 3 0
      src/misc.h

+ 1 - 0
doc/UPDATES

@@ -49,6 +49,7 @@
 * Fix restart causing bot to change nick (this was a regression in jupenick)
 * Removed 'chanset +knock' and replaced with 'chanset knock (Op|Voice|User)', see 'help chaninfo'
 * Default log timestamp now includes seconds
+* Hubs no longer include their own timestamp over botnet
 
 1.2.16.1
 * Fix linux compile errors

+ 2 - 1
src/botmsg.c

@@ -319,7 +319,8 @@ void putbot(const char *bot, char *par)
 */
 void botnet_send_log(int idx, const char *from, int type, const char *msg)
 {
-  const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "lo %s %d %s\n", from, type, msg);
+  // Cut out timestamp
+  const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "lo %s %d %s\n", from, type, &msg[LOG_TS_LEN]);
 
   if (conf.bot->hub) {
     send_hubs_but(idx, OBUF, len);

+ 3 - 0
src/misc.h

@@ -11,6 +11,9 @@
  */
 #define LOG_TS "[%H:%M:%S]"
 
+// Define this to be the length of the entire timestamp after replacing vars
+#define LOG_TS_LEN 10
+
 
 void restart(int);
 int coloridx(int);