]> code.citadel.org Git - citadel.git/commitdiff
* <.R>ead <U>ser-list now takes advantage of the server-side string match
authorArt Cancro <ajc@citadel.org>
Thu, 21 Jul 2005 17:20:55 +0000 (17:20 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 21 Jul 2005 17:20:55 +0000 (17:20 +0000)
  if available.  It still filters on the client side as well, in case the
  server is older and sent back the whole list.

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/citadel_ipc.c
citadel/citadel_ipc.h
citadel/userlist.c

index 9ec6b3fede5b4960f096cfe711c043cfeb840d1a..b092ba99c47e253263fe5105e31de74da3d4e3c2 100644 (file)
@@ -1,4 +1,9 @@
 $Log$
+Revision 653.7  2005/07/21 17:20:55  ajc
+* <.R>ead <U>ser-list now takes advantage of the server-side string match
+  if available.  It still filters on the client side as well, in case the
+  server is older and sent back the whole list.
+
 Revision 653.6  2005/07/21 15:02:27  ajc
 * Server-side LIST command now accepts a search string.
 
@@ -6941,4 +6946,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 58846072b990060cad796cc2c3f219aea416b950..021872e546b395245fcad604b1af439f5160e636 100644 (file)
@@ -211,7 +211,7 @@ void userlist(CtdlIPC *ipc, char *patn)
        int r;                          /* IPC response code */
        char *listing = NULL;
 
-       r = CtdlIPCUserListing(ipc, &listing, buf);
+       r = CtdlIPCUserListing(ipc, patn, &listing, buf);
        if (r / 100 != 1) {
                pprintf("%s\n", buf);
                return;
index a45dc5405483be3b06d98e630f9c14d3ac821a53..6f7ca30c75c9c42691dce7d63caa91b45e6cb056 100644 (file)
@@ -302,8 +302,8 @@ cmd=30,0,&.,&Terminate,and &Stay online
 # the trailing colon allows the user to enter a few characters to search for
 # users with a partial match.
 #
-cmd=32,0,&.,&Read,&User listing
-#cmd=32,0,&.,&Read,&User listing:
+#cmd=32,0,&.,&Read,&User listing
+cmd=32,0,&.,&Read,&User listing:
 
 cmd=33,0,&.,&Read,&Textfile formatted
 #
index 3a72ac180db1e815b73577264c5cb3ba89fea934..62b7d92dd5ba99a0b94a049810e1d827e718ef25 100644 (file)
@@ -1021,15 +1021,23 @@ int CtdlIPCSetRoomInfo(CtdlIPC *ipc, int for_real, const char *info, char *cret)
 
 
 /* LIST */
-int CtdlIPCUserListing(CtdlIPC *ipc, char **listing, char *cret)
+int CtdlIPCUserListing(CtdlIPC *ipc, char *searchstring, char **listing, char *cret)
 {
        size_t bytes;
+       char *cmd;
+       int ret;
 
        if (!cret) return -1;
        if (!listing) return -1;
        if (*listing) return -1;
+       if (!searchstring) return -1;
 
-       return CtdlIPCGenericCommand(ipc, "LIST", NULL, 0, listing, &bytes, cret);
+       cmd = malloc(strlen(searchstring) + 10);
+       sprintf(cmd, "LIST %s", searchstring);
+
+       ret = CtdlIPCGenericCommand(ipc, cmd, NULL, 0, listing, &bytes, cret);
+       free(cmd);
+       return(ret);
 }
 
 
index ba37904dddc71aaea32594cf120266b59243093c..1bd48dafb3374cc1f92766db2d0c8987b2c9208b 100644 (file)
@@ -231,7 +231,7 @@ int CtdlIPCValidateUser(CtdlIPC *ipc, const char *username, int axlevel,
                char *cret);
 int CtdlIPCSetRoomInfo(CtdlIPC *ipc, int for_real, const char *info,
                char *cret);
-int CtdlIPCUserListing(CtdlIPC *ipc, char **list, char *cret);
+int CtdlIPCUserListing(CtdlIPC *ipc, char *searchstring, char **list, char *cret);
 int CtdlIPCSetRegistration(CtdlIPC *ipc, const char *info, char *cret);
 int CtdlIPCMiscCheck(CtdlIPC *ipc, struct ctdlipcmisc *chek, char *cret);
 int CtdlIPCDeleteFile(CtdlIPC *ipc, const char *filename, char *cret);
index 59a398d7999843eb238a50e94d514e9335c9e04e..de102e2116303b875ad0a1b6dd58f29127b792df 100644 (file)
@@ -39,7 +39,7 @@ void userlist(CtdlIPC *ipc) {
        char *listing = NULL;
        int r;
 
-       r = CtdlIPCUserListing(ipc, &listing, buf);
+       r = CtdlIPCUserListing(ipc, "", &listing, buf);
        if (r / 100 != 1) {
                printf("%s\n", buf);
                return;