* Restructured cmd_auto() to be able to search vCards in more than one room.
authorArt Cancro <ajc@citadel.org>
Thu, 15 Sep 2005 21:37:06 +0000 (21:37 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 15 Sep 2005 21:37:06 +0000 (21:37 +0000)
  For now we are using the Global Address Book as the second room, but in
  production that might be a bit too slow.

citadel/ChangeLog
citadel/serv_autocompletion.c
citadel/serv_vcard.c
citadel/sysconfig.h

index 7123fea2814a7232402c2b7b66936df4cf393d6c..c10e93aed64ed338e9d455ada17a9adb3fc085fa 100644 (file)
@@ -1,4 +1,9 @@
 $Log$
+Revision 655.4  2005/09/15 21:37:06  ajc
+* Restructured cmd_auto() to be able to search vCards in more than one room.
+  For now we are using the Global Address Book as the second room, but in
+  production that might be a bit too slow.
+
 Revision 655.3  2005/09/15 18:36:29  ajc
 * serv_smtp.c: Allow the use of *any* RFC822-compliant address format,
   including Name <user@node>, or user@node (Name), by stripping down the
@@ -7119,4 +7124,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 109a0efdb6fae15fbdf1ebfbc5553648ace74b89..42bc907e5986ed4e9fd31f0fa6fe723eb3245630 100644 (file)
@@ -172,19 +172,24 @@ void cmd_auto(char *argbuf) {
        }
 
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
+       cprintf("%d try these:\n", LISTING_FOLLOWS);
 
-       if (getroom(&CC->room, USERCONTACTSROOM) != 0) {
-               getroom(&CC->room, hold_rm);
-               lprintf(CTDL_CRIT, "cannot get user contacts room\n");
-               cprintf("%d Your address book was not found.\n", ERROR + ROOM_NOT_FOUND);
-               return;
+       /* Take a spin through the user's personal address book */
+       if (getroom(&CC->room, USERCONTACTSROOM) == 0) {
+               CtdlForEachMessage(MSGS_ALL, 0, "text/x-vcard", NULL,
+                                       hunt_for_autocomplete, search_string);
        }
-
-       cprintf("%d try these:\n", LISTING_FOLLOWS);
-       CtdlForEachMessage(MSGS_ALL, 0, "text/x-vcard", NULL, hunt_for_autocomplete, search_string);
+       
+       /* FIXME try the global address book */
+       if (getroom(&CC->room, ADDRESS_BOOK_ROOM) == 0) {
+               CtdlForEachMessage(MSGS_ALL, 0, "text/x-vcard", NULL,
+                                       hunt_for_autocomplete, search_string);
+       }
+       
        cprintf("000\n");
-
-       getroom(&CC->room, hold_rm);    /* return to saved room */
+       if (strcmp(&CC->room.QRname, hold_rm)) {
+               getroom(&CC->room, hold_rm);    /* return to saved room */
+       }
 }
 
 
index 0d18e893acb65a9f7d0065681e731d872395dcbd..25b561d9cd1d324cd725bc146fab8c8660cf1533 100644 (file)
@@ -7,13 +7,6 @@
  * Copyright (c) 1999-2002 / released under the GNU General Public License
  */
 
-/*
- * Where we keep messages containing the vCards that source our directory.  It
- * makes no sense to change this, because you'd have to change it on every
- * system on the network.  That would be stupid.
- */
-#define ADDRESS_BOOK_ROOM      "Global Address Book"
-
 /*
  * Format of the "Exclusive ID" field of the message containing a user's
  * vCard.  Doesn't matter what it really looks like as long as it's both
index 822575f713d4ecc6aa4993f9a8ea2bc107be44f8..545ddfee16a4139b471a83c3bf0ccab8aa49c562 100644 (file)
 #define SMTP_SPOOLOUT_ROOM     "__CitadelSMTPspoolout__"
 #define DELETED_MSGS_ROOM      "__CitadelDeletedMessages__"
 
+/*
+ * Where we keep messages containing the vCards that source our directory.  It
+ * makes no sense to change this, because you'd have to change it on every
+ * system on the network.  That would be stupid.
+ */
+#define ADDRESS_BOOK_ROOM      "Global Address Book"
+
+
 /*
  * How long (in seconds) to retain message entries in the use table
  */