]> code.citadel.org Git - citadel.git/commitdiff
* citadel.c: don't truncate roomname when user is idle, in long who list;
authorMichael Hampton <io_error@uncensored.citadel.org>
Tue, 20 May 2003 01:28:50 +0000 (01:28 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Tue, 20 May 2003 01:28:50 +0000 (01:28 +0000)
  display idle time in short who list

citadel/ChangeLog
citadel/citadel.c

index 6487737529c4a73acce68e398b25115d9ce174f5..8e3d9f08206bc06d63f3d418d88430af0f82f18f 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 606.1  2003/05/20 01:28:50  error
+ * citadel.c: don't truncate roomname when user is idle, in long who list;
+   display idle time in short who list
+
  Revision 606.0  2003/05/16 15:17:11  ajc
  * THIS IS 6.06
 
@@ -4710,4 +4714,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index ce114f505c0ddbaf8bf2b5c5aed9d3b885ccd61b..81395624b2bc1bfb05a3c0596ee26ae25fea104e 100644 (file)
@@ -823,10 +823,12 @@ void who_is_online(CtdlIPC *ipc, int longlist)
                        idlesecs = (idletime - (idlehours * 3600) - (idlemins * 60));
 
                        if (idletime > rc_idle_threshold) {
+                               /*
                                while (strlen(roomname) < 20) {
                                        strcat(roomname, " ");
                                }
                                strcpy(&roomname[14], "[idle]");
+                               */
                                if (skipidle)
                                        isidle = 1;
                        }
@@ -870,8 +872,26 @@ void who_is_online(CtdlIPC *ipc, int longlist)
                                color(BRIGHT_CYAN);
                                pprintf("%-25s ", username);
                                color(BRIGHT_MAGENTA);
-                               roomname[20] = 0;
-                               pprintf("%-20s ", roomname);
+                               if (idletime > rc_idle_threshold) {
+                                       roomname[14] = 0;
+                                       pprintf("%-14s", roomname);
+                                       /* over 10 days, must be gone fishing */
+                                       if (idlehours > 239) {
+                                               pprintf("[fish] ");
+                                       /* over 10 hours */
+                                       } else if (idlehours > 9) {
+                                               pprintf("[%1ldd%02ld] ",
+                                                       idlehours / 24,
+                                                       idlehours % 24);
+                                       /* less than 10 hours */
+                                       } else {
+                                               pprintf("[%1ld:%02ld] ",
+                                                       idlehours, idlemins);
+                                       }
+                               } else {
+                                       roomname[20] = 0;
+                                       pprintf("%-20s ", roomname);
+                               }
                                color(BRIGHT_CYAN);
                                fromhost[24] = '\0';
                                pprintf("%-24s\n", fromhost);