$Log$
+ Revision 601.4 2002/09/11 03:17:18 ajc
+ * [EXPERIMENTAL] Link in the "libical" calendar library if present
+ * Rename serv_ical to serv_calendar (because the resulting module would be
+ named "libical" which conflicts with the external library by that name)
+
Revision 601.3 2002/09/10 08:07:38 error
* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00* update citadel.spec for 6.00
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
modules/libbio.la \
modules/libexpire.la \
modules/libvandelay.la \
- modules/libical.la
+ modules/libcalendar.la
UTIL_TARGETS=aidepost msgform readlog \
stats citmail userlist sendcommand \
base64 migratenet$(EXEEXT)
client_passwords.c imap_misc.c serv_netfilter.c serv_mrtg.c \
serv_spam.c citadel_ipc.c serv_listsub.c \
serv_imap.c imap_tools.c imap_fetch.c imap_search.c imap_store.c \
- serv_network.c serv_pas2.c serv_ical.c md5.c server_main.c
+ serv_network.c serv_pas2.c serv_calendar.c md5.c server_main.c
DEP_FILES=$(SOURCES:.c=.d)
modules/libpas2.la: serv_pas2.lo md5.lo $(LIBTOOL) libcitserver.la
$(LTSHARE) -o libpas2.la ../serv_pas2.lo ../md5.lo ../libcitserver.la
-modules/libical.la: serv_ical.lo $(LIBTOOL) libcitserver.la
- $(LTSHARE) -o libical.la ../serv_ical.lo ../libcitserver.la
+modules/libcalendar.la: serv_calendar.lo $(LIBTOOL) libcitserver.la
+ $(LTSHARE) -o libcalendar.la ../serv_calendar.lo ../libcitserver.la
citmail: citmail.o config.o
$(CC) citmail.o config.o $(LDFLAGS) -o citmail $(LIBS)
/* define this if you have zlib compression available */
#undef HAVE_ZLIB
+
+/* define this if you have the libical calendaring library available */
+#undef HAVE_LIBICAL
/usr/local/citadel/modules/libexpire.la
/usr/local/citadel/modules/libvandelay.so
/usr/local/citadel/modules/libvandelay.la
-/usr/local/citadel/modules/libical.so
-/usr/local/citadel/modules/libical.la
+/usr/local/citadel/modules/libcalendar.so
+/usr/local/citadel/modules/libcalendar.la
/usr/local/citadel/modules/liblistsub.so
/usr/local/citadel/modules/liblistsub.la
/usr/local/citadel/modules/libmrtg.so
AC_ARG_WITH(ncurses, [ --without-ncurses don't use ncurses])
AC_ARG_WITH(with_zlib, [ --with-zlib use zlib compression if present])
+AC_ARG_WITH(with_libical, [ --with-libical use libical calendaring library])
if test "x$with_gdbm" != xno -a "x$with_gdbm" != xyes -a "$with_gdbm"; then
db_dir="$with_gdbm"
with_db=no])
fi
+
+
dnl Checks for the zlib compression library.
if test "x$with_zlib" != xno ; then
AC_CHECK_HEADERS(zlib.h,
AC_DEFINE(HAVE_ZLIB)
fi
+
+
+dnl Checks for the libical calendaring library.
+if test "x$with_libical" != xno ; then
+ AC_CHECK_HEADERS(ical.h,
+ [AC_CHECK_LIB(ical, icalcomponent_new,
+ [ok_libical=yes],,
+ )])
+fi
+
+if test "x$ok_libical" != xno ; then
+ LIBS="-lical $LIBS"
+ AC_DEFINE(HAVE_LIBICAL)
+fi
+
+
+
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
--- /dev/null
+/*
+ * $Id$
+ *
+ * This module implements iCalendar object processing and the My Calendar>
+ * room on a Citadel/UX server. It handles iCalendar objects using the
+ * iTIP protocol. See RFCs 2445 and 2446.
+ *
+ */
+
+#include "sysdep.h"
+#include <unistd.h>
+#include <sys/types.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include "serv_ical.h"
+#include "citadel.h"
+#include "server.h"
+#include "citserver.h"
+#include "sysdep_decls.h"
+#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 */
+void cmd_ical(char *argbuf)
+{
+ /* argbuf is not used */
+ if (!(CC->logged_in)) {
+ cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
+ return;
+ }
+
+ cprintf("%d I support|ICAL\n", CIT_OK);
+ return;
+}
+
+
+/* We don't know if the calendar room exists so we just create it at login */
+void ical_create_room(void)
+{
+ struct quickroom qr;
+
+ /* Create the 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");
+ return;
+ }
+ qr.QRep.expire_mode = EXPIRE_MANUAL;
+ lputroom(&qr);
+ lprintf(9, "Set user calendar room to manual expire\n");
+ return;
+}
+
+
+/* See if we need to prevent the object from being saved */
+int ical_obj_beforesave(struct CtdlMessage *msg)
+{
+ char roomname[ROOMNAMELEN];
+ char *p;
+ int a;
+
+ /*
+ * 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
+ * so that the message may not be posted.
+ */
+
+ /* First determine if this is our room */
+ MailboxName(roomname, sizeof roomname, &CC->usersupp, USERCALENDARROOM);
+ if (strncmp(roomname, msg->cm_fields['O'], ROOMNAMELEN))
+ return 0; /* It's not us... */
+
+ /* Then determine content-type of the message */
+
+ /* It must be an RFC822 message! */
+ /* FIXME: Not handling MIME multipart messages; implement with IMIP */
+ if (msg->cm_format_type != 4)
+ return 1; /* You tried to save a non-RFC822 message! */
+
+ /* Find the Content-Type: header */
+ p = msg->cm_fields['M'];
+ a = strlen(p);
+ while (--a > 0) {
+ if (!strncasecmp(p, "Content-Type: ", 14)) { /* Found it */
+ if (!strncasecmp(p + 14, "text/x-calendar", 15) ||
+ !strncasecmp(p + 14, "text/calendar", 13))
+ return 0;
+ else
+ return 1;
+ }
+ p++;
+ }
+
+ /* Oops! No Content-Type in this message! How'd that happen? */
+ lprintf(7, "RFC822 message with no Content-Type header!\n");
+ return 1;
+}
+
+
+
+/* Register this module with the Citadel server. */
+char *Dynamic_Module_Init(void)
+{
+ CtdlRegisterSessionHook(ical_create_room, EVT_LOGIN);
+ CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
+ CtdlRegisterProtoHook(cmd_ical, "ICAL", "Register iCalendar support");
+ return "$Id$";
+}
--- /dev/null
+/*
+ * $Id$
+ *
+ * iCalendar implementation for Citadel/UX
+ *
+ */
+
+
+/* Hrm, we don't have anything to put here yet... */
+++ /dev/null
-/*
- * $Id$
- *
- * This module implements iCalendar object processing and the My Calendar>
- * room on a Citadel/UX server. It handles iCalendar objects using the
- * iTIP protocol. See RFCs 2445 and 2446.
- *
- */
-
-#include "sysdep.h"
-#include <unistd.h>
-#include <sys/types.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#include "serv_ical.h"
-#include "citadel.h"
-#include "server.h"
-#include "citserver.h"
-#include "sysdep_decls.h"
-#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 */
-void cmd_ical(char *argbuf)
-{
- /* argbuf is not used */
- if (!(CC->logged_in)) {
- cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
- return;
- }
-
- cprintf("%d I support|ICAL\n", CIT_OK);
- return;
-}
-
-
-/* We don't know if the calendar room exists so we just create it at login */
-void ical_create_room(void)
-{
- struct quickroom qr;
-
- /* Create the 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");
- return;
- }
- qr.QRep.expire_mode = EXPIRE_MANUAL;
- lputroom(&qr);
- lprintf(9, "Set user calendar room to manual expire\n");
- return;
-}
-
-
-/* See if we need to prevent the object from being saved */
-int ical_obj_beforesave(struct CtdlMessage *msg)
-{
- char roomname[ROOMNAMELEN];
- char *p;
- int a;
-
- /*
- * 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
- * so that the message may not be posted.
- */
-
- /* First determine if this is our room */
- MailboxName(roomname, sizeof roomname, &CC->usersupp, USERCALENDARROOM);
- if (strncmp(roomname, msg->cm_fields['O'], ROOMNAMELEN))
- return 0; /* It's not us... */
-
- /* Then determine content-type of the message */
-
- /* It must be an RFC822 message! */
- /* FIXME: Not handling MIME multipart messages; implement with IMIP */
- if (msg->cm_format_type != 4)
- return 1; /* You tried to save a non-RFC822 message! */
-
- /* Find the Content-Type: header */
- p = msg->cm_fields['M'];
- a = strlen(p);
- while (--a > 0) {
- if (!strncasecmp(p, "Content-Type: ", 14)) { /* Found it */
- if (!strncasecmp(p + 14, "text/x-calendar", 15) ||
- !strncasecmp(p + 14, "text/calendar", 13))
- return 0;
- else
- return 1;
- }
- p++;
- }
-
- /* Oops! No Content-Type in this message! How'd that happen? */
- lprintf(7, "RFC822 message with no Content-Type header!\n");
- return 1;
-}
-
-
-
-/* Register this module with the Citadel server. */
-char *Dynamic_Module_Init(void)
-{
- CtdlRegisterSessionHook(ical_create_room, EVT_LOGIN);
- CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
- CtdlRegisterProtoHook(cmd_ical, "ICAL", "Register iCalendar support");
- return "$Id$";
-}
+++ /dev/null
-/*
- * $Id$
- *
- * iCalendar implementation for Citadel/UX
- *
- */
-
-
-/* Hrm, we don't have anything to put here yet... */