From: Art Cancro Date: Thu, 15 Sep 2005 21:37:06 +0000 (+0000) Subject: * Restructured cmd_auto() to be able to search vCards in more than one room. X-Git-Tag: v7.86~4654 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=64d87c019e0d48be0069980b1205928d92dfbcae * 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. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 7123fea28..c10e93aed 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 , or user@node (Name), by stripping down the @@ -7119,4 +7124,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/serv_autocompletion.c b/citadel/serv_autocompletion.c index 109a0efdb..42bc907e5 100644 --- a/citadel/serv_autocompletion.c +++ b/citadel/serv_autocompletion.c @@ -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 */ + } } diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 0d18e893a..25b561d9c 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -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 diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 822575f71..545ddfee1 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -113,6 +113,14 @@ #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 */