$Log$
+ Revision 573.79 2001/02/03 09:30:46 error
+ * serv_ical.c: now creates a My Calendar> personal room, sets attributes
+
Revision 573.78 2001/02/03 08:21:00 error
* serv_ical.c and serv_ical.h added; skeleton code for now
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
#include "support.h"
#include "config.h"
#include "dynloader.h"
+#include "user_ops.h"
+#include "room_ops.h"
/* Tell clients what level of support to expect */
}
+/* We can't know if the calendar room exists so we just create it at login */
+void ical_create_room(void)
+{
+ char roomname[ROOMNAMELEN];
+ struct quickroom qr;
+
+ /* Create the room if it doesn't already exist */
+ MailboxName(roomname, &CC->usersupp, USERCALENDARROOM);
+ create_room(roomname, 4, "", 0);
+ /* Set expiration policy to manual; otherwise objects will be lost! */
+ if (lgetroom(&qr, roomname)) {
+ lprintf(3, "Couldn't get the user calendar room!\n");
+ return;
+ }
+ qr.QRep.expire_mode = EXPIRE_MANUAL;
+ lputroom(&qr);
+ return;
+}
+
+
+/* User is reading a message */
+int ical_obj_beforeread(struct CtdlMessage *msg)
+{
+ return 0;
+}
+
+
+/* See if we need to prevent the object from being saved */
int ical_obj_beforesave(struct CtdlMessage *msg)
{
return 0;
}
+/* aftersave processing */
int ical_obj_aftersave(struct CtdlMessage *msg)
{
return 0;
/* Register this module with the Citadel server. */
char *Dynamic_Module_Init(void)
{
+ CtdlRegisterSessionHook(ical_create_room, EVT_LOGIN);
+ CtdlRegisterMessageHook(ical_obj_beforeread, EVT_BEFOREREAD);
CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
CtdlRegisterMessageHook(ical_obj_aftersave, EVT_AFTERSAVE);
CtdlRegisterProtoHook(cmd_ical, "ICAL", "Register iCalendar support");
#define MAILROOM "Mail"
#define AIDEROOM "Aide"
#define USERCONFIGROOM "My Citadel Config"
+#define USERCALENDARROOM "My Calendar"
#define PAGELOGROOM "Sent/Received Pages"
#define SYSCONFIGROOM "Local System Configuration"
#define SMTP_SPOOLOUT_ROOM "__CitadelSMTPspoolout__"