From: Art Cancro Date: Tue, 17 Sep 2002 03:18:15 +0000 (+0000) Subject: * Create the Calendar> and Tasks> rooms at login time, and set their default X-Git-Tag: v7.86~6231 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6592248cb0718b0432ee500688047f04a87cc1f7 * Create the Calendar> and Tasks> rooms at login time, and set their default views to calendar and tasklist views. Renamed "My Calendar>" to "Calendar>" to be in sync with the KDE groupware project. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index cb1403a02..c8b6d5046 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ + Revision 601.7 2002/09/17 03:18:15 ajc + * Create the Calendar> and Tasks> rooms at login time, and set their default + views to calendar and tasklist views. Renamed "My Calendar>" to "Calendar>" + to be in sync with the KDE groupware project. + Revision 601.6 2002/09/15 03:24:28 ajc * Renamed decode_base64() to CtdlDecodeBase64() * Renamed decode_quoted_printable() to CtdlDecodeQuotedPrintable() @@ -4004,3 +4009,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_calendar.c b/citadel/serv_calendar.c index f101f0b0b..acff373bb 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -1,7 +1,7 @@ /* * $Id$ * - * This module implements iCalendar object processing and the My Calendar> + * This module implements iCalendar object processing and the Calendar> * room on a Citadel/UX server. It handles iCalendar objects using the * iTIP protocol. See RFCs 2445 and 2446. * @@ -42,13 +42,17 @@ void cmd_ical(char *argbuf) } -/* We don't know if the calendar room exists so we just create it at login */ +/* + * We don't know if the calendar room exists so we just create it at login + */ void ical_create_room(void) { struct quickroom qr; + struct visit vbuf; - /* Create the room if it doesn't already exist */ + /* Create the calendar room if it doesn't already exist */ create_room(USERCALENDARROOM, 4, "", 0, 1, 0); + /* Set expiration policy to manual; otherwise objects will be lost! */ if (lgetroom(&qr, USERCALENDARROOM)) { lprintf(3, "Couldn't get the user calendar room!\n"); @@ -56,7 +60,28 @@ void ical_create_room(void) } qr.QRep.expire_mode = EXPIRE_MANUAL; lputroom(&qr); - lprintf(9, "Set user calendar room to manual expire\n"); + + /* Set the view to a calendar view */ + CtdlGetRelationship(&vbuf, &CC->usersupp, &qr); + vbuf.v_view = 3; /* 3 = calendar */ + CtdlSetRelationship(&vbuf, &CC->usersupp, &qr); + + /* Create the tasks list room if it doesn't already exist */ + create_room(USERTASKSROOM, 4, "", 0, 1, 0); + + /* Set expiration policy to manual; otherwise objects will be lost! */ + if (lgetroom(&qr, USERTASKSROOM)) { + lprintf(3, "Couldn't get the user calendar room!\n"); + return; + } + qr.QRep.expire_mode = EXPIRE_MANUAL; + lputroom(&qr); + + /* Set the view to a task list view */ + CtdlGetRelationship(&vbuf, &CC->usersupp, &qr); + vbuf.v_view = 4; /* 4 = tasks */ + CtdlSetRelationship(&vbuf, &CC->usersupp, &qr); + return; } @@ -70,8 +95,8 @@ int ical_obj_beforesave(struct CtdlMessage *msg) /* * Only messages with content-type text/calendar or text/x-calendar - * may be saved to My Calendar>. If the message is bound for - * My Calendar> but doesn't have this content-type, throw an error + * may be saved to Calendar>. If the message is bound for + * Calendar> but doesn't have this content-type, throw an error * so that the message may not be posted. */ diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index f2d79b21d..8fc4d7af0 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -112,7 +112,8 @@ #define SENTITEMS "Sent Items" #define AIDEROOM "Aide" #define USERCONFIGROOM "My Citadel Config" -#define USERCALENDARROOM "My Calendar" +#define USERCALENDARROOM "Calendar" +#define USERTASKSROOM "Tasks" #define PAGELOGROOM "Sent/Received Pages" #define SYSCONFIGROOM "Local System Configuration" #define SMTP_SPOOLOUT_ROOM "__CitadelSMTPspoolout__"