]> code.citadel.org Git - citadel.git/blobdiff - webcit/serv_func.c
WebCit now detects whether the Citadel server has Sieve support
[citadel.git] / webcit / serv_func.c
index 188129e0dda0322585b61f80dbbbd6fa7567e935..589bc6540bb53086d733541752d471a025ed5b47 100644 (file)
@@ -89,6 +89,12 @@ void get_serv_info(char *browser_host, char *user_agent)
                case 15:
                        serv_info.serv_newuser_disabled = atoi(buf);
                        break;
+               case 16:
+                       safestrncpy(serv_info.serv_default_cal_zone, buf, sizeof serv_info.serv_default_cal_zone);
+                       break;
+               case 19:
+                       serv_info.serv_supports_sieve = atoi(buf);
+                       break;
                }
                ++a;
        }
@@ -195,7 +201,7 @@ void pullquote_fmout(void) {
 void text_to_server(char *ptr)
 {
        char buf[256];
-       int ch, a, pos;
+       int ch, a, pos, len;
 
        pos = 0;
        buf[0] = 0;
@@ -203,9 +209,11 @@ void text_to_server(char *ptr)
        while (ptr[pos] != 0) {
                ch = ptr[pos++];
                if (ch == 10) {
-                       while ( (isspace(buf[strlen(buf) - 1]))
-                         && (strlen(buf) > 1) )
-                               buf[strlen(buf) - 1] = 0;
+                       len = strlen(buf);
+                       while ( (isspace(buf[len - 1]))
+                               && (buf[0] !=  '\0') 
+                               && (buf[1] !=  '\0') )
+                               buf[--len] = 0;
                        serv_puts(buf);
                        buf[0] = 0;
                        if (ptr[pos] != 0) strcat(buf, " ");