From: Art Cancro Date: Tue, 9 Jul 2002 04:21:14 +0000 (+0000) Subject: * 'idle' icon X-Git-Tag: v7.86~6344 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=04f6eb10ab315349157f84b2d5ab2a96a0c091f7;p=citadel.git * 'idle' icon --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index f52a864ef..86c3d9744 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/static/idle.gif b/webcit/static/idle.gif new file mode 100644 index 000000000..9cf26c287 Binary files /dev/null and b/webcit/static/idle.gif differ diff --git a/webcit/who.c b/webcit/who.c index a1b2ca13b..7eb676c7f 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -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("User Name\n"); wprintf("Room"); wprintf("From host\n\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("\n\t%d", sess); if ((WC->is_aide) && @@ -85,7 +98,8 @@ void whobbs(void) wprintf("" - " "); @@ -97,6 +111,13 @@ void whobbs(void) escputs(user); wprintf(""); + if ((now - last_activity) > 900L) { + wprintf(" " + ""); + } + /* room */ wprintf("\n\t"); escputs(room);