* Configure "notes" view and auto-create Notes> room
authorArt Cancro <ajc@citadel.org>
Fri, 1 Oct 2004 15:58:08 +0000 (15:58 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Oct 2004 15:58:08 +0000 (15:58 +0000)
citadel/ChangeLog
citadel/citadel.h
citadel/serv_calendar.c
citadel/techdoc/views.txt

index 6b3444c5add680227354285357bbffe29f2c27bd..e73e9e694fef6d3ffc1b956efea0f1e822c9d5b1 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 626.1  2004/10/01 15:58:08  ajc
+ * Configure "notes" view and auto-create Notes> room
+
  Revision 626.0  2004/09/28 16:11:16  ajc
  * THIS IS 6.26
 
@@ -6122,4 +6125,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 9e30841adb6a750c1563f1a6a5cf14efcf30ef72..54911d4ecb7b6c31db3bdc8ae698ad4c7a401323 100644 (file)
@@ -321,6 +321,7 @@ enum {
 #define VIEW_ADDRESSBOOK       2       /* Address book view */
 #define VIEW_CALENDAR          3       /* Calendar view */
 #define VIEW_TASKS             4       /* Tasks view */
+#define VIEW_NOTES             5       /* Notes view */
 
 #ifdef __cplusplus
 }
index bffde202f7366f81c2ebc3f0538d3477c3ab8903..f63727b95bdb737352dfe8db98e79d9480faa017 100644 (file)
@@ -1422,7 +1422,7 @@ void ical_create_room(void)
 
        /* Set the view to a calendar view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
-       vbuf.v_view = 3;        /* 3 = calendar */
+       vbuf.v_view = VIEW_CALENDAR;
        CtdlSetRelationship(&vbuf, &CC->user, &qr);
 
        /* Create the tasks list room if it doesn't already exist */
@@ -1434,12 +1434,29 @@ void ical_create_room(void)
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
-       qr.QRdefaultview = VIEW_TASKS;  /* 4 = tasks view */
+       qr.QRdefaultview = VIEW_TASKS;
        lputroom(&qr);
 
        /* Set the view to a task list view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
-       vbuf.v_view = 4;        /* 4 = tasks */
+       vbuf.v_view = VIEW_TASKS;
+       CtdlSetRelationship(&vbuf, &CC->user, &qr);
+
+       /* Create the notes room if it doesn't already exist */
+       create_room(USERNOTESROOM, 4, "", 0, 1, 0, VIEW_NOTES);
+
+       /* Set expiration policy to manual; otherwise objects will be lost! */
+       if (lgetroom(&qr, USERNOTESROOM)) {
+               lprintf(CTDL_CRIT, "Couldn't get the user calendar room!\n");
+               return;
+       }
+       qr.QRep.expire_mode = EXPIRE_MANUAL;
+       qr.QRdefaultview = VIEW_NOTES;
+       lputroom(&qr);
+
+       /* Set the view to a notes view */
+       CtdlGetRelationship(&vbuf, &CC->user, &qr);
+       vbuf.v_view = VIEW_NOTES;
        CtdlSetRelationship(&vbuf, &CC->user, &qr);
 
        return;
index ee2aa5de2ef9836e0c14f5f3babbba15bf024c3d..497a3063fa85b5f382fed5057de641d22e684f10 100644 (file)
@@ -25,4 +25,5 @@ is in the room record as room.QRdefaultview (and is also an integer).
 #define VIEW_ADDRESSBOOK       2       /* Address book view */
 #define VIEW_CALENDAR          3       /* Calendar view */
 #define VIEW_TASKS             4       /* Tasks view */
+#define VIEW_NOTES             5       /* Notes view */