Added a global system config item for the default time
authorArt Cancro <ajc@citadel.org>
Wed, 19 Jul 2006 02:23:12 +0000 (02:23 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 19 Jul 2006 02:23:12 +0000 (02:23 +0000)
zone for unzoned calendar items.  Patched ical_dezonify to use it.

citadel/config.h
citadel/control.c
citadel/ical_dezonify.c
citadel/routines2.c
citadel/techdoc/protocol.txt

index c9289f96092074de352e705ce8be1c67113367d0..e476f8a1ddcdace3cb63bc86ba85fe74b2eb5a5a 100644 (file)
@@ -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       */
 };
 
 
index 5a7f2e97a9e7920b40561f3f0e5576d8ba312ad9..68bbd51c77f8178bb4f26a36cdc89fc88aab03dc 100644 (file)
@@ -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;
                }
index d7fb476709a9084c9d4b66a99f2775e3ad0222c4..ec5d868687947016b479c73f68d0f46e70b7a7c9 100644 (file)
  */
 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();
        }
index f20add33f8a18c3f2e24fa83974345c216879f65..a0116d1e7e39ca06f839bb2a0340140e1d553f56 100644 (file)
@@ -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];
index 712a887222d30ae048730cff2d750686e064bad5..87bb3ec53c1e6d59875be681baa3ba0948f35956 100644 (file)
@@ -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