]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_stats.c
Added check for flood settings in m_message. Why was this not here
[irc/rqf/shadowircd.git] / modules / m_stats.c
index 12adc9c3ff7ae2652596f94563f942e87bd1b7b3..dbc76994fec76b99bafaa88e33c04726f2d45deb 100644 (file)
@@ -704,7 +704,7 @@ stats_operedup (struct Client *source_p)
                if(IsOperInvis(target_p) && !IsOper(source_p))
                        continue;
 
-               if(get_metadata(target_p, "away"))
+               if(target_p->user->away)
                        continue;
 
                count++;
@@ -744,7 +744,7 @@ stats_tresv(struct Client *source_p)
                if(aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSQLINE, 
                                        form_str(RPL_STATSQLINE),
-                                       'q', aconf->port, aconf->name, aconf->passwd);
+                                       'q', aconf->port, aconf->host, aconf->passwd);
        }
 
        HASH_WALK(i, R_MAX, ptr, resvTable)
@@ -753,7 +753,7 @@ stats_tresv(struct Client *source_p)
                if(aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSQLINE, 
                                        form_str(RPL_STATSQLINE),
-                                       'q', aconf->port, aconf->name, aconf->passwd);
+                                       'q', aconf->port, aconf->host, aconf->passwd);
        }
        HASH_WALK_END
 }
@@ -772,7 +772,7 @@ stats_resv(struct Client *source_p)
                if(!aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSQLINE, 
                                        form_str(RPL_STATSQLINE),
-                                       'Q', aconf->port, aconf->name, aconf->passwd);
+                                       'Q', aconf->port, aconf->host, aconf->passwd);
        }
 
        HASH_WALK(i, R_MAX, ptr, resvTable)
@@ -781,7 +781,7 @@ stats_resv(struct Client *source_p)
                if(!aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSQLINE, 
                                        form_str(RPL_STATSQLINE),
-                                       'Q', aconf->port, aconf->name, aconf->passwd);
+                                       'Q', aconf->port, aconf->host, aconf->passwd);
        }
        HASH_WALK_END
 }
@@ -1081,7 +1081,7 @@ stats_tgecos(struct Client *source_p)
                if(aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSXLINE,
                                        form_str(RPL_STATSXLINE),
-                                       'x', aconf->port, aconf->name,
+                                       'x', aconf->port, aconf->host,
                                        aconf->passwd);
        }
 }
@@ -1099,7 +1099,7 @@ stats_gecos(struct Client *source_p)
                if(!aconf->hold)
                        sendto_one_numeric(source_p, RPL_STATSXLINE,
                                        form_str(RPL_STATSXLINE),
-                                       'X', aconf->port, aconf->name
+                                       'X', aconf->port, aconf->host
                                        aconf->passwd);
        }
 }
@@ -1137,6 +1137,7 @@ stats_memory (struct Client *source_p)
        int conf_count = 0;     /* conf lines */
        int users_invited_count = 0;    /* users invited */
        int user_channels = 0;  /* users in channels */
+       int aways_counted = 0;
        size_t number_servers_cached;   /* number of servers cached by scache */
 
        size_t channel_memory = 0;
@@ -1145,6 +1146,7 @@ stats_memory (struct Client *source_p)
        size_t channel_invex_memory = 0;
        size_t channel_quiet_memory = 0;
 
+       size_t away_memory = 0; /* memory used by aways */
        size_t ww = 0;          /* whowas array count */
        size_t wwm = 0;         /* whowas array memory used */
        size_t conf_memory = 0; /* memory used by conf lines */
@@ -1179,6 +1181,11 @@ stats_memory (struct Client *source_p)
                        users_counted++;
                        users_invited_count += rb_dlink_list_length(&target_p->user->invited);
                        user_channels += rb_dlink_list_length(&target_p->user->channel);
+                       if(target_p->user->away)
+                       {
+                               aways_counted++;
+                               away_memory += (strlen(target_p->user->away) + 1);
+                       }
                }
        }
 
@@ -1239,9 +1246,10 @@ stats_memory (struct Client *source_p)
                           (unsigned long) users_invited_count * sizeof(rb_dlink_node));
 
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
-                          "z :User channels %u(%lu)",
+                          "z :User channels %u(%lu) Aways %u(%d)",
                           user_channels,
-                          (unsigned long) user_channels * sizeof(rb_dlink_node));
+                          (unsigned long) user_channels * sizeof(rb_dlink_node),
+                          aways_counted, (int) away_memory);
 
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
                           "z :Attached confs %u(%lu)",