From: Art Cancro Date: Wed, 20 Aug 2003 03:36:13 +0000 (+0000) Subject: * Create a "Contacts" room for personal address book use X-Git-Tag: v7.86~5779 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=bdc77140d696fe60e35ef9ca597ca813496faa6c * Create a "Contacts" room for personal address book use --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 89b6d0a89..edf6156e8 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 610.1 2003/08/20 03:36:13 ajc + * Create a "Contacts" room for personal address book use + Revision 610.0 2003/08/17 03:00:37 ajc * THIS IS 6.10 @@ -4970,3 +4973,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 08d128016..443783172 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -757,6 +757,35 @@ void cmd_qdir(char *argbuf) { } +/* + * We don't know if the Contacts room exists so we just create it at login + */ +void vcard_create_room(void) +{ + struct ctdlroom qr; + struct visit vbuf; + + /* Create the calendar room if it doesn't already exist */ + create_room(USERCONTACTSROOM, 4, "", 0, 1, 0); + + /* Set expiration policy to manual; otherwise objects will be lost! */ + if (lgetroom(&qr, USERCONTACTSROOM)) { + lprintf(3, "Couldn't get the user CONTACTS room!\n"); + return; + } + qr.QRep.expire_mode = EXPIRE_MANUAL; + qr.QRdefaultview = 2; /* 2 = address book view */ + lputroom(&qr); + + /* Set the view to a calendar view */ + CtdlGetRelationship(&vbuf, &CC->user, &qr); + vbuf.v_view = 2; /* 2 = address book view */ + CtdlSetRelationship(&vbuf, &CC->user, &qr); + + return; +} + + /* @@ -777,6 +806,8 @@ void vcard_session_login_hook(void) { vcard_populate_cs_inet_email(v); vcard_free(v); + + vcard_create_room(); } diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 9c6d6610a..9f683c68b 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -113,6 +113,7 @@ #define USERCONFIGROOM "My Citadel Config" #define USERCALENDARROOM "Calendar" #define USERTASKSROOM "Tasks" +#define USERCONTACTSROOM "Contacts" #define PAGELOGROOM "Sent/Received Pages" #define SYSCONFIGROOM "Local System Configuration" #define SMTP_SPOOLOUT_ROOM "__CitadelSMTPspoolout__"