Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_settime.c
index 7077690f696337b93af9b9b17e252f2de01fd170..a75a3c00fc3ebc77438cc5774299f74497b74fb2 100644 (file)
@@ -124,7 +124,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SETTIME");
 
   if (parc == 2 && MyUser(sptr))
-    parv[parc++] = me.name;
+    parv[parc++] = cli_name(&me);
 
   t = atoi(parv[1]);
   dt = TStime() - t;
@@ -141,8 +141,8 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sprintf_irc(tbuf, TIME_T_FMT, TStime());
     parv[1] = tbuf;
 #endif
-    for (lp = me.serv->down; lp; lp = lp->next)
-      if (cptr != lp->value.cptr && MsgQLength(&lp->value.cptr->sendQ) < 8000)
+    for (lp = cli_serv(&me)->down; lp; lp = lp->next)
+      if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
        sendcmdto_one(sptr, CMD_NOTICE, lp->value.cptr, "%s", parv[1]);
   }
   else
@@ -157,7 +157,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 #ifdef RELIABLE_CLOCK
   if ((dt > 600) || (dt < -600))
     sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
-                         sptr->name, t);
+                         cli_name(sptr), t);
   if (IsUser(sptr))
   {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
@@ -166,7 +166,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
 #else
   sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
-                      "seconds %s", sptr->name, (dt < 0) ? -dt : dt,
+                      "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
                       (dt < 0) ? "forwards" : "backwards");
   TSoffset -= dt;
   if (IsUser(sptr))
@@ -200,7 +200,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SETTIME");
 
   if (parc == 2 && MyUser(sptr))
-    parv[parc++] = me.name;
+    parv[parc++] = cli_name(&me);
 
   t = atoi(parv[1]);
   dt = TStime() - t;
@@ -217,8 +217,8 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sprintf_irc(tbuf, TIME_T_FMT, TStime());
     parv[1] = tbuf;
 #endif
-    for (lp = me.serv->down; lp; lp = lp->next)
-      if (cptr != lp->value.cptr && MsgQLength(&lp->value.cptr->sendQ) < 8000)
+    for (lp = cli_serv(&me)->down; lp; lp = lp->next)
+      if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
        sendcmdto_one(sptr, CMD_SETTIME, lp->value.cptr, "%s", parv[1]);
   }
   else
@@ -233,7 +233,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 #ifdef RELIABLE_CLOCK
   if ((dt > 600) || (dt < -600))
     sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
-                         sptr->name, t);
+                         cli_name(sptr), t);
   if (IsUser(sptr))
   {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
@@ -242,7 +242,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
 #else
   sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
-                      "seconds %s", sptr->name, (dt < 0) ? -dt : dt,
+                      "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
                       (dt < 0) ? "forwards" : "backwards");
   TSoffset -= dt;
   if (IsUser(sptr))