* 'idle' icon
authorArt Cancro <ajc@citadel.org>
Tue, 9 Jul 2002 04:21:14 +0000 (04:21 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 9 Jul 2002 04:21:14 +0000 (04:21 +0000)
webcit/ChangeLog
webcit/static/idle.gif [new file with mode: 0644]
webcit/who.c

index f52a864efa73401527d7cc024c364aa41813172f..86c3d9744144a6c876c913246a30d0e44f1a589f 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 323.44  2002/07/09 04:21:12  ajc
+* 'idle' icon
+
 Revision 323.43  2002/07/06 03:10:26  ajc
 * Enable a "make this my start page" link that works in lots of places.
   Configures a user's preference of where to go after login.
@@ -852,3 +855,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
diff --git a/webcit/static/idle.gif b/webcit/static/idle.gif
new file mode 100644 (file)
index 0000000..9cf26c2
Binary files /dev/null and b/webcit/static/idle.gif differ
index a1b2ca13b538a3c8629a4ade68eec20dde1b9310..7eb676c7f72a4c25b9c1a2b8c5974d32fa8d394a 100644 (file)
@@ -33,6 +33,8 @@ void whobbs(void)
 {
        char buf[SIZ], sess, user[SIZ], room[SIZ], host[SIZ],
                realroom[SIZ], realhost[SIZ];
+       time_t last_activity;
+       time_t now;
 
        output_headers(7);
 
@@ -56,6 +58,16 @@ void whobbs(void)
        wprintf("<TH>User Name</TH>\n");
        wprintf("<TH>Room</TH>");
        wprintf("<TH>From host</TH>\n</TR>\n");
+
+       serv_puts("TIME");
+       serv_gets(buf);
+       if (buf[0] == '2') {
+               now = extract_long(&buf[4], 0);
+       }
+       else {
+               now = time(NULL);
+       }
+
        serv_puts("RWHO");
        serv_gets(buf);
        if (buf[0] == '1') {
@@ -66,6 +78,7 @@ void whobbs(void)
                        extract(host, buf, 3);
                        extract(realroom, buf, 9);
                        extract(realhost, buf, 10);
+                       last_activity = extract_long(buf, 5);
 
                        wprintf("<TR>\n\t<TD ALIGN=center>%d", sess);
                        if ((WC->is_aide) &&
@@ -85,7 +98,8 @@ void whobbs(void)
                        wprintf("<A HREF=\"/display_page&recp=");
                        urlescputs(user);
                        wprintf("\">"
-                               "<IMG ALIGN=MIDDLE SRC=\"/static/page.gif\" "
+                               "<IMG ALIGN=MIDDLE WIDTH=20 HEIGHT=15 "
+                               "SRC=\"/static/page.gif\" "
                                "ALT=\"(p)\""
                                " BORDER=0></A>&nbsp;");
 
@@ -97,6 +111,13 @@ void whobbs(void)
                        escputs(user);
                        wprintf("</A>");
 
+                       if ((now - last_activity) > 900L) {
+                               wprintf("&nbsp;"
+                                       "<IMG ALIGN=MIDDLE "
+                                       "SRC=\"/static/idle.gif\" "
+                                       "ALT=\"[idle]\" BORDER=0>");
+                       }
+
                        /* room */
                        wprintf("</TD>\n\t<TD>");
                        escputs(room);