]> code.citadel.org Git - citadel.git/commitdiff
* policy.c: fix bug in GetExpirePolicy() that was causing the default
authorArt Cancro <ajc@citadel.org>
Sun, 1 Feb 2004 06:19:22 +0000 (06:19 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 1 Feb 2004 06:19:22 +0000 (06:19 +0000)
  mailbox purge policy to be misinterpreted if it was set to "use
  system default"
* serv_vcard.c: always set the Global Address Book room's expire policy
  to "never expire" and its default view to "address book"

citadel/ChangeLog
citadel/policy.c
citadel/serv_vcard.c

index 51c00237120a05ccdc4574af12db4a5fa438d090..4090c92c35e23efa64ed9e52de1bcaea2a788d82 100644 (file)
@@ -1,4 +1,11 @@
  $Log$
+ Revision 614.12  2004/02/01 06:19:22  ajc
+ * policy.c: fix bug in GetExpirePolicy() that was causing the default
+   mailbox purge policy to be misinterpreted if it was set to "use
+   system default"
+ * serv_vcard.c: always set the Global Address Book room's expire policy
+   to "never expire" and its default view to "address book"
+
  Revision 614.11  2004/01/31 05:44:29  ajc
  *** empty log message ***
 
@@ -5251,3 +5258,4 @@ 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 7ad326c3c274bf8812a9680156a66818102e238e..d267ac80b80b88a2f1a9ca10d1f7eed9bec5ada6 100644 (file)
@@ -68,7 +68,7 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
         * If there is a default policy for mailbox rooms, return it
         */
        if (qrbuf->QRflags & QR_MAILBOX) {
-               if (&config.c_mbxep.expire_mode != 0) {
+               if (config.c_mbxep.expire_mode != 0) {
                        memcpy(epbuf, &config.c_mbxep,
                                sizeof(struct ExpirePolicy));
                        return;
index 9e2b3381585086e2b7f98a98c3062563163c86cb..16947b926aea47309651719437864a16c355547c 100644 (file)
@@ -819,6 +819,8 @@ void vcard_session_login_hook(void) {
 
 char *serv_vcard_init(void)
 {
+       struct ctdlroom qr;
+
        CtdlRegisterSessionHook(vcard_session_startup_hook, EVT_START);
        CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN);
        CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
@@ -831,6 +833,16 @@ char *serv_vcard_init(void)
        CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
        CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
        CtdlRegisterNetprocHook(vcard_extract_from_network);
+
+       /* Create the Global ADdress Book room if necessary */
        create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0);
+
+       /* Set expiration policy to manual; otherwise objects will be lost! */
+       if (!lgetroom(&qr, ADDRESS_BOOK_ROOM)) {
+               qr.QRep.expire_mode = EXPIRE_MANUAL;
+               qr.QRdefaultview = 2;   /* 2 = address book view */
+               lputroom(&qr);
+       }
+
        return "$Id$";
 }