فهرست منبع

* Didn't fix that logging correctly

svn: 2027
Bryan Drewery 21 سال پیش
والد
کامیت
e2e8642237
4فایلهای تغییر یافته به همراه7 افزوده شده و 10 حذف شده
  1. 2 5
      src/botcmd.c
  2. 3 3
      src/botmsg.c
  3. 1 1
      src/log.c
  4. 1 1
      src/tandem.h

+ 2 - 5
src/botcmd.c

@@ -509,11 +509,8 @@ static void bot_log(int idx, char *par)
   if (egg_isdigit(par[0])) {
     int type = atoi(newsplit(&par));
 
-    if (conf.bot->hub) {
-      size_t len = simple_sprintf(OBUF, "lo %s %s\n", from, par);
-     
-      send_hubs_but(idx, OBUF, len);
-    }
+    if (conf.bot->hub)
+      botnet_send_log(idx, from, type, par);
 
     putlog(type, "@", "(%s) %s", from, par);
 

+ 3 - 3
src/botmsg.c

@@ -297,12 +297,12 @@ void putbot(char *bot, char *par)
 	 - sends to uplink if a leaf
 	 - sends to all linked hubs if a hub
 */
-void botnet_send_log(int type, const char *msg)
+void botnet_send_log(int idx, const char *from, int type, const char *msg)
 {
-  size_t len = simple_sprintf(OBUF, "lo %s %d %s\n", conf.bot->nick, type, msg);
+  size_t len = simple_sprintf(OBUF, "lo %s %d %s\n", from, type, msg);
 
   if (conf.bot->hub) {
-    send_hubs(OBUF, len);
+    send_hubs_but(idx, OBUF, len);
   } else {
     send_uplink(OBUF, len);
   }

+ 1 - 1
src/log.c

@@ -174,7 +174,7 @@ void putlog(int type, const char *chname, const char *format, ...)
 
   /* broadcast to hubs */
   if (chname[0] == '*' && conf.bot && conf.bot->nick)
-    botnet_send_log(type, out);
+    botnet_send_log(-1, conf.bot->nick, type, out);
 
   for (idx = 0; idx < dcc_total; idx++) {
     if (dcc[idx].type && (dcc[idx].type == &DCC_CHAT && !dcc[idx].simul) && (dcc[idx].u.chat->con_flags & type)) {

+ 1 - 1
src/tandem.h

@@ -58,7 +58,7 @@ void botnet_send_link(int, char *, char *, char *);
 void botnet_send_update(int, tand_t *);
 void botnet_send_nlinked(int, char *, char *, char, int, time_t, char *);
 void botnet_send_reject(int, char *, char *, char *, char *, char *);
-void botnet_send_log(int, const char *);
+void botnet_send_log(int, const char *, int, const char *);
 void botnet_send_zapf(int, char *, char *, char *);
 void botnet_send_zapf_broad(int, char *, char *, char *);
 void botnet_send_away(int, char *, int, char *, int);