]> code.citadel.org Git - citadel.git/commitdiff
Remove 'can_do_msg4' variable from client. If
authorArt Cancro <ajc@citadel.org>
Sun, 14 Oct 2007 04:30:27 +0000 (04:30 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 14 Oct 2007 04:30:27 +0000 (04:30 +0000)
anyone is pointing a 2007 client at a pre-2002 server, they've
already got other problems.  This simplifies things a bit.

citadel/citadel.c
citadel/citadel_decls.h
citadel/html.c
citadel/messages.c

index c8c05146ceca3f6425eb2903e8a749803a7fd8d6..4a71ccc0ee34aeb2289a369383891ed4a37724ff 100644 (file)
@@ -104,7 +104,6 @@ char curr_floor = 0;                /* number of current floor */
 char floorlist[128][SIZ];      /* names of floors */
 int termn8 = 0;                        /* Set to nonzero to cause a logoff */
 int secure;                    /* Set to nonzero when wire is encrypted */
-int can_do_msg4 = 0;           /* Set to nonzero if the server can handle MSG4 commands */
 
 extern char instant_msgs;      /* instant messages waiting! */
 extern int rc_ansi_color;      /* ansi color value from citadel.rc */
@@ -1155,8 +1154,9 @@ void get_serv_info(CtdlIPC *ipc, char *supplied_hostname)
         * isn't really all that great, it's probably better to just go with
         * the plain text when we have it available.
         */
-       if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "text/plain|text/html") / 100 )== 2) {
-               can_do_msg4 = 1;
+       if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "text/plain|text/html") / 100 ) != 2) {
+               scr_printf("ERROR: Extremely old server; MSG4 framework not supported.\n");
+               logoff(ipc, 0);
        }
 }
 
index 8e95f1ad6c67404db55622d4fbfa3841cf0caa1c..c5bbf2eb784f06175c34b26c327a0c8a2728d285 100644 (file)
@@ -30,5 +30,4 @@ void ctdl_logoff(char *file, int line, CtdlIPC *ipc, int code);
 void formout(CtdlIPC *ipc, char *name);
 void sighandler(int which_sig);
 extern int secure;
-extern int can_do_msg4;
 void remove_march(char *roomname, int floornum);
index 2a5a663d55c6805d7b6bf85b2e7c60b8e16f90f5..ad22efdf25da00fc25dfc1a23584019d91fe619e 100644 (file)
@@ -49,6 +49,7 @@
  */
 char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaformat) {
        char inbuf[SIZ];
+       int inbuf_len = 0;
        char outbuf[SIZ];
        char tag[1024];
        int done_reading = 0;
@@ -78,12 +79,13 @@ char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaform
 
        do {
                /* Fill the input buffer */
-               if ( (done_reading == 0) && (strlen(inbuf) < (SIZ-128)) ) {
+               inbuf_len = strlen(inbuf);
+               if ( (done_reading == 0) && (inbuf_len < (SIZ-128)) ) {
 
                        ch = *inptr++;
                        if (ch != 0) {
-                               inbuf[strlen(inbuf)+1] = 0;
-                               inbuf[strlen(inbuf)] = ch;
+                               inbuf[inbuf_len++] = ch;
+                               inbuf[inbuf_len] = 0;
                        } 
                        else {
                                done_reading = 1;
@@ -99,6 +101,7 @@ char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaform
                /* Do some parsing */
                if (!IsEmptyStr(inbuf)) {
 
+
                    /* Fold in all the spacing */
                    for (i=0; !IsEmptyStr(&inbuf[i]); ++i) {
                        if (inbuf[i]==10) inbuf[i]=32;
index 97529331e094fd5a1e61e3e3485be2103ed1bd94..0d822804c346bdc13f37340976cd0753aac35354 100644 (file)
@@ -405,9 +405,7 @@ int read_message(CtdlIPC *ipc,
        strcpy(reply_to, NO_REPLY_TO);
        strcpy(reply_subject, "");
 
-       r = CtdlIPCGetSingleMessage(ipc, num, (pagin == READ_HEADER ? 1 : 0),
-                               (can_do_msg4 ? 4 : 0),
-                               &message, buf);
+       r = CtdlIPCGetSingleMessage(ipc, num, (pagin == READ_HEADER ? 1 : 0), 4, &message, buf);
        if (r / 100 != 1) {
                err_printf("*** msg #%ld: %d %s\n", num, r, buf);
                ++lines_printed;
@@ -707,7 +705,7 @@ int read_message(CtdlIPC *ipc,
        }
 
        /* Enumerate any attachments */
-       if ( (pagin == 1) && (can_do_msg4) && (message->attachments) ) {
+       if ( (pagin == 1) && (message->attachments) ) {
                struct parts *ptr;
 
                for (ptr = message->attachments; ptr; ptr = ptr->next) {