Explorar el Código

* Removed define UTCTIME
* All dates are UTC (GMT) now.


svn: 1160

Bryan Drewery hace 22 años
padre
commit
b0cb8d4551
Se han modificado 12 ficheros con 5 adiciones y 83 borrados
  1. 0 1
      config.h.in
  2. 2 1
      doc/UPDATES
  3. 3 13
      src/cmds.c
  4. 0 4
      src/log.c
  5. 0 8
      src/main.c
  6. 0 12
      src/misc.c
  7. 0 4
      src/mod/channels.mod/cmdschan.c
  8. 0 8
      src/mod/irc.mod/cmdsirc.c
  9. 0 4
      src/mod/irc.mod/irc.c
  10. 0 4
      src/mod/notes.mod/notes.c
  11. 0 8
      src/userent.c
  12. 0 16
      src/users.c

+ 0 - 1
config.h.in

@@ -344,4 +344,3 @@
 #undef S_MESSUPTERM
 #undef S_NAZIPASS
 #undef S_SPLITHIJACK
-#undef S_UTCTIME

+ 2 - 1
doc/UPDATES

@@ -5,8 +5,9 @@ This is a summary of ChangeLog basically.
 * Wrote new 'response' code for misc stuff like kick reasons, and dcc responses...
 * Removed many unnecesary compile defines: (.config controlling them makes more sense)
   ANTITRACE, HIJACKCHECK, LASTCHECK, NODELAY, PROCESSCHECK, PROMISC, AUTHCMDS, CONFEDIT
-  RANDSERVERS, DCCPASS, PSCLOAK, MSGCMDS
+  RANDSERVERS, DCCPASS, PSCLOAK, MSGCMDS, UTCTIME
   -Moved PSCLOAK entries to misc/responses.txt
+* All dates are UTC (GMT) now.
 
 1.1.9
 

+ 3 - 13
src/cmds.c

@@ -120,11 +120,7 @@ static void tell_who(struct userrec *u, int idx, int chan)
 	ok = 1;
 	dprintf(idx, "Bots connected:\n");
       }
-#ifdef S_UTCTIME
       egg_strftime(s, 14, "%d %b %H:%M %Z", gmtime(&dcc[i].timeval));
-#else /* !S_UTCTIME */
-      egg_strftime(s, 14, "%d %b %H:%M %Z", localtime(&dcc[i].timeval));
-#endif /* S_UTCTIME */
       if (atr & USER_OWNER) {
         egg_snprintf(format, sizeof format, "  [%%.2lu]  %%s%%c%%-%us (%%s) %%s\n", 
 			    nicklen);
@@ -1318,21 +1314,15 @@ static void cmd_console(struct userrec *u, int idx, char *par)
 
 static void cmd_date(struct userrec *u, int idx, char *par)
 {
-  char date[50] = "", utctime[50] = "", ltime[50] = "";
+  char date[50] = "";
   time_t hub;
 
   putlog(LOG_CMDS, "*", "#%s# date", dcc[idx].nick);
 
   egg_strftime(date, sizeof date, "%c %Z", localtime(&now));
-#ifndef S_UTCTIME
-  sprintf(ltime, "<-- This time is used on the bot.");
-#endif /* !S_UTCTIME */
-  dprintf(idx, "%s %s\n", date, (ltime && ltime[0]) ? ltime : "");
+  dprintf(idx, "%s (local shell time)\n", date);
   egg_strftime(date, sizeof date, "%c %Z", gmtime(&now));
-#ifdef S_UTCTIME
-  sprintf(utctime, "<-- This time is used on the bot.");
-#endif /* S_UTCTIME */
-  dprintf(idx, "%s %s\n", date, (utctime && utctime[0]) ? utctime : "");
+  dprintf(idx, "%s <-- This time is use don the bot.\n", date);
   
   hub = now + timesync;
   egg_strftime(date, sizeof date, "%c %Z", gmtime(&hub));

+ 0 - 4
src/log.c

@@ -146,11 +146,7 @@ void putlog(int type, const char *chname, const char *format, ...)
 
   va_start(va, format);
 #ifdef HUB
-# ifdef S_UTCTIME
   t = gmtime(&now);
-# else /* !S_UTCTIME */
-  t = localtime(&now);
-# endif /* S_UTCTIME */
 
   egg_strftime(stamp, sizeof(stamp), LOG_TS, t);
 #endif /* HUB */

+ 0 - 8
src/main.c

@@ -429,11 +429,7 @@ static void core_secondly()
     cnt = 0;
   }
 
-#ifdef S_UTCTIME
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
-#else /* !S_UTCTIME */
-  egg_memcpy(&nowtm, localtime(&now), sizeof(struct tm));
-#endif /* S_UTCTIME */
   if (nowtm.tm_min != lastmin) {
     int i = 0;
 
@@ -707,11 +703,7 @@ int main(int argc, char **argv)
   timer_update_now(&egg_timeval_now);
   now = egg_timeval_now.sec;
 
-#ifdef S_UTCTIME
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
-#else /* !S_UTCTIME */
-  egg_memcpy(&nowtm, localtime(&now), sizeof(struct tm));
-#endif /* S_UTCTIME */
   lastmin = nowtm.tm_min;
   srandom(now % (getpid() + getppid()) * randint(1000));
   myuid = geteuid();

+ 0 - 12
src/misc.c

@@ -363,11 +363,7 @@ void daysago(time_t mynow, time_t then, char *out)
     sprintf(out, "%d day%s ago", mydays, (mydays == 1) ? "" : "s");
     return;
   }
-#ifdef S_UTCTIME
   egg_strftime(out, 6, "%H:%M", gmtime(&then));
-#else /* !S_UTCTIME */
-  egg_strftime(out, 6, "%H:%M", localtime(&then));
-#endif /* S_UTCTIME */
 }
 
 /* Convert an interval (in seconds) to one of:
@@ -381,11 +377,7 @@ void days(time_t mynow, time_t then, char *out)
     sprintf(out, "in %d day%s", mydays, (mydays == 1) ? "" : "s");
     return;
   }
-#ifdef S_UTCTIME
   egg_strftime(out, 9, "at %H:%M", gmtime(&now));
-#else /* !S_UTCTIME */
-  egg_strftime(out, 9, "at %H:%M", localtime(&now));
-#endif /* S_UTCTIME */
 }
 
 /* Convert an interval (in seconds) to one of:
@@ -453,11 +445,7 @@ void show_motd(int idx)
     buf = buf_ptr = strdup(CFG_MOTD.gdata);
     who = newsplit(&buf);
     when = atoi(newsplit(&buf));
-#ifdef S_UTCTIME
     egg_strftime(date, sizeof date, "%c %Z", gmtime(&when));
-#else /* !S_UTCTIME */
-    egg_strftime(date, sizeof date, "%c %Z", localtime(&when));
-#endif /* S_UTCTIME */
     dprintf(idx, "Motd set by %s%s%s (%s)\n", BOLD(idx), who, BOLD_END(idx), date);
     dumplots(idx, "* ", replace(buf, "\\n", "\n"));
     dprintf(idx, " \n");

+ 0 - 4
src/mod/channels.mod/cmdschan.c

@@ -1193,11 +1193,7 @@ static void cmd_chaninfo(struct userrec *u, int idx, char *par)
     char nick[NICKLEN] = "", date[81] = "";
 
     if (chan->added_ts) {
-#ifndef S_UTCTIME
-      egg_strftime(date, sizeof date, "%c %Z", localtime(&(chan->added_ts)));
-#else /* !S_UTCTIME */
       egg_strftime(date, sizeof date, "%c %Z", gmtime(&(chan->added_ts)));
-#endif /* S_UTCTIME */
     } else
       date[0] = 0;
     if (chan->added_by && chan->added_by[0])

+ 0 - 8
src/mod/irc.mod/cmdsirc.c

@@ -1272,17 +1272,9 @@ static void cmd_channel(struct userrec *u, int idx, char *par)
       int hops = m->hops;
       if (m->joined > 0) {
 	if ((now - (m->joined)) > 86400)
-#ifdef S_UTCTIME
 	  egg_strftime(s, 6, "%d%b", gmtime(&(m->joined)));
-#else /* !S_UTCTIME */
-	  egg_strftime(s, 6, "%d%b", localtime(&(m->joined)));
-#endif /* S_UTCTIME */
 	else
-#ifdef S_UTCTIME
 	  egg_strftime(s, 6, "%H:%M", gmtime(&(m->joined)));
-#else /* !S_UTCTIME */
-	  egg_strftime(s, 6, "%H:%M", localtime(&(m->joined)));
-#endif /* S_UTCTIME */
       } else
 	strncpyz(s, " --- ", sizeof s);
       if (m->user == NULL) {

+ 0 - 4
src/mod/irc.mod/irc.c

@@ -651,11 +651,7 @@ static void punish_badguy(struct chanset_t *chan, char *whobad,
   get_user_flagrec(u, &fr, chan->dname);
 
   /* Get current time into a string */
-#ifdef S_UTCTIME
   egg_strftime(ct, sizeof ct, "%d %b %Z", gmtime(&now));
-#else /* !S_UTCTIME */
-  egg_strftime(ct, sizeof ct, "%d %b %Z", localtime(&now));
-#endif /* S_UTCTIME */
 
   /* Put together log and kick messages */
   reason[0] = 0;

+ 0 - 4
src/mod/notes.mod/notes.c

@@ -401,11 +401,7 @@ void notes_read(const char *hand, const char *nick, const char *srd, int idx)
 	  from = newsplit(&s1);
 	  dt = newsplit(&s1);
 	  tt = atoi(dt);
-#ifdef S_UTCTIME
 	  egg_strftime(wt, sizeof wt, "%b %d %H:%M %Z", gmtime(&tt));
-#else /* !S_UTCTIME */
-	  egg_strftime(wt, sizeof wt, "%b %d %H:%M %Z", localtime(&tt));
-#endif /* S_UTCTIME */
 	  dt = wt;
 	  lapse = (int) ((now - tt) / 86400);
 	  if (lapse > note_life - 7) {

+ 0 - 8
src/userent.c

@@ -181,11 +181,7 @@ void added_display(int idx, struct user_entry *e, struct userrec *u)
       *hnd++ = 0;
     tm = atoi(tmp);
 
-#ifdef S_UTCTIME
     egg_strftime(tmp2, sizeof(tmp2), "%a, %d %b %Y %H:%M:%S %Z", gmtime(&tm));
-#else /* !S_UTCTIME */
-    egg_strftime(tmp2, sizeof(tmp2), "%a, %d %b %Y %H:%M:%S %Z", localtime(&tm));
-#endif /* S_UTCTIME */
     if (hnd)
       dprintf(idx, "  -- Added %s by %s\n", tmp2, hnd);
     else
@@ -512,11 +508,7 @@ void modified_display(int idx, struct user_entry *e, struct userrec *u)
     if (hnd)
       *hnd++ = 0;
     tm = atoi(tmp);
-#ifdef S_UTCTIME
     egg_strftime(tmp2, sizeof(tmp2), "%a, %d %b %Y %H:%M:%S %Z", gmtime(&tm));
-#else /* !S_UTCTIME */
-    egg_strftime(tmp2, sizeof(tmp2), "%a, %d %b %Y %H:%M:%S %Z", localtime(&tm));
-#endif /* S_UTCTIME */
     if (hnd)
       dprintf(idx, "  -- Modified %s by %s\n", tmp2, hnd);
     else

+ 0 - 16
src/users.c

@@ -465,17 +465,9 @@ void tell_user(int idx, struct userrec *u, int master)
   else {
     now2 = now - li->laston;
     if (now2 > 86400)
-#ifdef S_UTCTIME
       egg_strftime(s1, 7, "%d %b", gmtime(&li->laston));
-#else /* !S_UTCTIME */
-      egg_strftime(s1, 7, "%d %b", localtime(&li->laston));
-#endif /* S_UTCTIME */
     else
-#ifdef S_UTCTIME
       egg_strftime(s1, 6, "%H:%M", gmtime(&li->laston));
-#else /* !S_UTCTIME */
-      egg_strftime(s1, 6, "%H:%M", localtime(&li->laston));
-#endif /* S_UTCTIME */
   }
   if (!u->bot) {
     egg_snprintf(format, sizeof format, "%%-%us %%-5s%%5d %%-15s %%s (%%-10.10s)\n", HANDLEN);
@@ -496,17 +488,9 @@ void tell_user(int idx, struct userrec *u, int master)
         else {
   	  now2 = now - (ch->laston);
 	  if (now2 > 86400)
-#ifdef S_UTCTIME
 	    egg_strftime(s1, 7, "%d %b", gmtime(&ch->laston));
-#else /* !S_UTCTIME */
-	    egg_strftime(s1, 7, "%d %b", localtime(&ch->laston));
-#endif /* S_UTCTIME */
 	  else
-#ifdef S_UTCTIME
 	    egg_strftime(s1, 6, "%H:%M", gmtime(&ch->laston));
-#else /* !S_UTCTIME */
-	    egg_strftime(s1, 6, "%H:%M", localtime(&ch->laston));
-#endif /* S_UTCTIME */
         }
         fr.match = FR_CHAN;
         fr.chan = ch->flags;