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 */
* 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);
}
}
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);
*/
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;
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;
/* 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;
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;
}
/* 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) {