]> code.citadel.org Git - citadel.git/commitdiff
added a .Wholist Short which lists only the people that aren't idle
authorStu Mark <theeverything@citadel.org>
Tue, 26 Feb 2002 23:37:16 +0000 (23:37 +0000)
committerStu Mark <theeverything@citadel.org>
Tue, 26 Feb 2002 23:37:16 +0000 (23:37 +0000)
citadel/citadel.c
citadel/citadel.rc

index 4ce0f8ec13d660f2c27b5c2af1f92dadbb4b793f..873074019a0b6243a882d5c10c5c9da633e21a27 100644 (file)
@@ -802,6 +802,13 @@ void who_is_online(int longlist)
        time_t timenow = 0;
        time_t idletime, idlehours, idlemins, idlesecs;
        int last_session = (-1);
+    int skipidle = 0;
+    
+    if (longlist == 2)
+      {
+        longlist = 0;
+        skipidle = 1;
+      }
 
        serv_puts("TIME");
        serv_gets(tbuf);
@@ -822,6 +829,7 @@ void who_is_online(int longlist)
        serv_gets(buf);
        if (buf[0] == '1') {
                while (serv_gets(buf), strcmp(buf, "000")) {
+               int isidle = 0;
                        extract(username, buf, 1);
                        extract(roomname, buf, 2);
                        extract(fromhost, buf, 3);
@@ -838,6 +846,8 @@ void who_is_online(int longlist)
                                        strcat(roomname, " ");
                                }
                                strcpy(&roomname[14], "[idle]");
+                       if (skipidle)
+                  isidle = 1;
                        }
 
                        if (longlist) {
@@ -867,24 +877,26 @@ void who_is_online(int longlist)
                                pprintf("\n");
 
                        } else {
-                               if (extract_int(buf, 0) == last_session) {
-                                       pprintf("        ");
-                               } else {
-                                       color(BRIGHT_MAGENTA);
-                                       pprintf("%-3s ", flags);
-                                       color(DIM_WHITE);
-                                       pprintf("%-3d ", extract_int(buf, 0));
-                               }
-                               last_session = extract_int(buf, 0);
-                               color(BRIGHT_CYAN);
-                               pprintf("%-25s ", username);
-                               color(BRIGHT_MAGENTA);
-                               roomname[20] = 0;
-                               pprintf("%-20s ", roomname);
-                               color(BRIGHT_CYAN);
-                               fromhost[24] = '\0';
-                               pprintf("%-24s\n", fromhost);
-                               color(DIM_WHITE);
+                   if (isidle == 0) {
+                               if (extract_int(buf, 0) == last_session) {
+                                       pprintf("        ");
+                               } else {
+                                       color(BRIGHT_MAGENTA);
+                                       pprintf("%-3s ", flags);
+                                       color(DIM_WHITE);
+                                       pprintf("%-3d ", extract_int(buf, 0));
+                               }
+                               last_session = extract_int(buf, 0);
+                               color(BRIGHT_CYAN);
+                               pprintf("%-25s ", username);
+                               color(BRIGHT_MAGENTA);
+                               roomname[20] = 0;
+                               pprintf("%-20s ", roomname);
+                               color(BRIGHT_CYAN);
+                               fromhost[24] = '\0';
+                               pprintf("%-24s\n", fromhost);
+                               color(DIM_WHITE);
+                       }
                        }
                }
        }
@@ -1558,6 +1570,10 @@ PWOK:
                                who_is_online(1);
                                break;
 
+            case 91:
+                who_is_online(2);
+                break;
+                
                        case 80:
                                do_system_configuration();
                                break;
index a7579dc7414e35f78b560540cca520c41a105a65..e5b825dac563b0482b446b830a2cd472bf136cc4 100644 (file)
@@ -299,6 +299,7 @@ cmd=67,0,&.,&Read,&Bio
 cmd=79,0,&.,&Wholist,&Long
 cmd=75,0,&.,&Wholist,&Roomname
 cmd=76,0,&.,&Wholist,&Hostname
+cmd=91,0,&.,&Wholist,&Active
 
 #
 # Command 69 allows the user to enter a server command directly.  It is