]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_trace.c
Remove obsolete comment.
[irc/rqf/shadowircd.git] / modules / m_trace.c
index 1ae65dd94b3e5b2af32eed206a093cb8b8126f8c..603922e6fe781111ccbbfae83cd898a30af5fa47 100644 (file)
@@ -63,9 +63,10 @@ DECLARE_MODULE_AV1(trace, NULL, NULL, trace_clist, trace_hlist, NULL, "$Revision
 static void count_downlinks(struct Client *server_p, int *pservcount, int *pusercount);
 static int report_this_status(struct Client *source_p, struct Client *target_p);
 
+static const char *empty_sockhost = "255.255.255.255";
+
 /*
  * m_trace
- *      parv[0] = sender prefix
  *      parv[1] = servername
  */
 static int
@@ -345,7 +346,7 @@ report_this_status(struct Client *source_p, struct Client *target_p)
        class_name = get_client_class(target_p);
 
        if(IsAnyServer(target_p))
-               name = get_server_name(target_p, HIDE_IP);
+               name = target_p->name;
        else
                name = get_client_name(target_p, HIDE_IP);
 
@@ -379,21 +380,15 @@ report_this_status(struct Client *source_p, struct Client *target_p)
 
        case STAT_CLIENT:
                {
-                       if(IsOper(target_p))
-                               sendto_one_numeric(source_p, RPL_TRACEOPERATOR,
-                                                  form_str(RPL_TRACEOPERATOR),
-                                                  class_name, name,
-                                                  show_ip(source_p, target_p) ? ip : "255.255.255.255",
-                                                  rb_current_time() - target_p->localClient->lasttime,
-                                                  rb_current_time() - target_p->localClient->last);
+                       int tnumeric;
+
+                       tnumeric = IsOper(target_p) ? RPL_TRACEOPERATOR : RPL_TRACEUSER;
+                       sendto_one_numeric(source_p, tnumeric, form_str(tnumeric),
+                                       class_name, name,
+                                       show_ip(source_p, target_p) ? ip : empty_sockhost,
+                                       rb_current_time() - target_p->localClient->lasttime,
+                                       rb_current_time() - target_p->localClient->last);
 
-                       else
-                               sendto_one_numeric(source_p, RPL_TRACEUSER, 
-                                                  form_str(RPL_TRACEUSER),
-                                                  class_name, name,
-                                                  show_ip(source_p, target_p) ? ip : "255.255.255.255",
-                                                  rb_current_time() - target_p->localClient->lasttime,
-                                                  rb_current_time() - target_p->localClient->last);
                        cnt++;
                }
                break;