From f5a6e5e01c858e24d4198555f976b8c5089f10aa Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 1 Oct 2004 15:58:08 +0000 Subject: [PATCH] * Configure "notes" view and auto-create Notes> room --- citadel/ChangeLog | 4 +++- citadel/citadel.h | 1 + citadel/serv_calendar.c | 23 ++++++++++++++++++++--- citadel/techdoc/views.txt | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 6b3444c5a..e73e9e694 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.h b/citadel/citadel.h index 9e30841ad..54911d4ec 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -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 } diff --git a/citadel/serv_calendar.c b/citadel/serv_calendar.c index bffde202f..f63727b95 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -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; diff --git a/citadel/techdoc/views.txt b/citadel/techdoc/views.txt index ee2aa5de2..497a3063f 100644 --- a/citadel/techdoc/views.txt +++ b/citadel/techdoc/views.txt @@ -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 */ -- 2.39.2