Procházet zdrojové kódy

* Fixed up the *_report() showing in cmd_status

svn: 873
Bryan Drewery před 22 roky
rodič
revize
c2d6d3051b
3 změnil soubory, kde provedl 26 přidání a 9 odebrání
  1. 1 0
      doc/UPDATES
  2. 2 5
      src/chanprog.c
  3. 23 4
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -26,6 +26,7 @@ This is a summary of ChangeLog basically.
    Original default list will apply for options you leave out.
 23.Bot now saves/checks it's binary md5 checksum.
 24.Removed the majority of the garblestrings. Was slowing the bot down.
+25.cmd_status now shows all information correctly.
 
 1.1.3
 1.Fixed a very fatal bug with channel ctcps.

+ 2 - 5
src/chanprog.c

@@ -260,9 +260,7 @@ void tell_verbose_uptime(int idx)
 void tell_verbose_status(int idx)
 {
   char s[256] = "", s1[121] = "", s2[81] = "", *vers_t = NULL, *uni_t = NULL;
-#ifdef HUB
   int i;
-#endif /* HUB */
   time_t now2, hr, min;
 #if HAVE_GETRUSAGE
   struct rusage ru;
@@ -281,12 +279,11 @@ void tell_verbose_status(int idx)
     uni_t = un.sysname;
   }
 
-#ifdef HUB
   i = count_users(userlist);
-  dprintf(idx, "I am %s, running %s:  %d user%s\n",
-	  conf.bot->nick, ver, i, i == 1 ? "" : "s");
+  dprintf(idx, "I am %s, running %s:  %d user%s\n", conf.bot->nick, ver, i, i == 1 ? "" : "s");
   if (localhub)
     dprintf(idx, "I am a localhub.\n");
+#ifdef HUB
   if (isupdatehub())
     dprintf(idx, "I am an update hub.\n");
 #endif /* HUB */

+ 23 - 4
src/cmds.c

@@ -1128,9 +1128,20 @@ static void cmd_channels(struct userrec *u, int idx, char *par) {
 }
 
 
+int dns_report(int, int);  
+void channels_report(int, int);
+#ifdef LEAF
+void server_report(int, int);
+void irc_report(int, int);
+#endif /* LEAF */
+void transfer_report(int, int);
+void share_report(int, int);
+void update_report(int, int);
+void notes_report(int, int);
+
 static void cmd_status(struct userrec *u, int idx, char *par)
 {
-  int atr = u ? u->flags : 0;
+  int atr = u ? u->flags : 0, all = 0;
 
   if (!egg_strcasecmp(par, "all")) {
     if (!(atr & USER_MASTER)) {
@@ -1141,13 +1152,21 @@ static void cmd_status(struct userrec *u, int idx, char *par)
     tell_verbose_status(idx);
     dprintf(idx, "\n");
     tell_settings(idx);
-/* FIXME: call the _report functions here */
-    /* do_module_report(idx, 1, NULL); */
+    all++;
   } else {
     putlog(LOG_CMDS, "*", "#%s# status", dcc[idx].nick);
     tell_verbose_status(idx);
-    /* do_module_report(idx, 0, NULL); */
   }
+  dns_report(idx, all);  
+#ifdef LEAF
+  server_report(idx, all);
+  irc_report(idx, all);
+#endif /* LEAF */
+  channels_report(idx, all);
+  transfer_report(idx, all);
+  share_report(idx, all);
+  update_report(idx, all);
+  notes_report(idx, all);
 }
 
 static void cmd_dccstat(struct userrec *u, int idx, char *par)