From fa36b0df38c64a226ec3076215567d6b3f572d42 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 19 Jul 2006 02:23:12 +0000 Subject: [PATCH] Added a global system config item for the default time zone for unzoned calendar items. Patched ical_dezonify to use it. --- citadel/config.h | 1 + citadel/control.c | 4 ++++ citadel/ical_dezonify.c | 11 +++-------- citadel/routines2.c | 2 +- citadel/techdoc/protocol.txt | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/citadel/config.h b/citadel/config.h index c9289f960..e476f8a1d 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -72,6 +72,7 @@ struct config { char c_journal_email; /* Perform journaling of email */ char c_journal_pubmsgs; /* Perform journaling of non-email */ char c_journal_dest[128]; /* Where to send journalized msgs */ + char c_default_cal_zone[128]; /* Default calendar time zone */ }; diff --git a/citadel/control.c b/citadel/control.c index 5a7f2e97a..68bbd51c7 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -221,6 +221,7 @@ void cmd_conf(char *argbuf) cprintf("%d\n", config.c_journal_email); cprintf("%d\n", config.c_journal_pubmsgs); cprintf("%s\n", config.c_journal_dest); + cprintf("%s\n", config.c_default_cal_zone); cprintf("000\n"); } @@ -416,6 +417,9 @@ void cmd_conf(char *argbuf) case 48: safestrncpy(config.c_journal_dest, buf, sizeof config.c_journal_dest); + case 49: + safestrncpy(config.c_default_cal_zone, buf, + sizeof config.c_default_cal_zone); } ++a; } diff --git a/citadel/ical_dezonify.c b/citadel/ical_dezonify.c index d7fb47670..ec5d86868 100644 --- a/citadel/ical_dezonify.c +++ b/citadel/ical_dezonify.c @@ -36,11 +36,8 @@ */ icaltimezone *get_default_icaltimezone(void) { - char *location = NULL; icaltimezone *zone = NULL; - - /* This doesn't even belong here. I'm just keeping it here until I put it somewhere permanent. @@ -53,11 +50,9 @@ icaltimezone *get_default_icaltimezone(void) { } */ - - location = "America/New_York"; - if (location) { - zone = icaltimezone_get_builtin_timezone(location); - } + if (!zone) { + zone = icaltimezone_get_builtin_timezone(config.c_default_cal_zone); + } if (!zone) { zone = icaltimezone_get_utc_timezone(); } diff --git a/citadel/routines2.c b/citadel/routines2.c index f20add33f..a0116d1e7 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc) void do_system_configuration(CtdlIPC *ipc) { -#define NUM_CONFIGS 49 +#define NUM_CONFIGS 50 char buf[SIZ]; char sc[NUM_CONFIGS][256]; diff --git a/citadel/techdoc/protocol.txt b/citadel/techdoc/protocol.txt index 712a88722..87bb3ec53 100644 --- a/citadel/techdoc/protocol.txt +++ b/citadel/techdoc/protocol.txt @@ -1881,6 +1881,7 @@ fails for any reason, ERROR is returned. 46. Flag (0 or 1) - perform journaling of email messages 47. Flag (0 or 1) - perform journaling of non-email messages 48. Address to which journalized messages are to be sent + 49. Default time zone (Olsen database name) for unzoned calendar items CONF also accepts two additional commands: GETSYS and PUTSYS followed by an arbitrary MIME type (such as application/x-citadel-internet-config) which -- 2.30.2