]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
Brought over message reading functions from old WebCit
[citadel.git] / webcit / webcit.c
index 1cc25206fded038f154575382ee7ae7b0dbe8ffc..e0c731829afb5e9b355339ff6c750a29b19ee67f 100644 (file)
@@ -245,53 +245,6 @@ void urlescputs(char *strbuf)
        }
 
 
-/*
- * Look for URL's embedded in a buffer and make them linkable.  We use a
- * target window in order to keep the BBS session in its own window.
- */
-void url(char *buf)
-{
-
-       int pos;
-       int start,end;
-       char ench;
-       char urlbuf[256];
-       char outbuf[256];
-
-       start = (-1);
-       end = strlen(buf);
-       ench = 0;
-
-       for (pos=0; pos<strlen(buf); ++pos) {
-               if (!strncasecmp(&buf[pos],"http://",7)) start = pos;
-               if (!strncasecmp(&buf[pos],"ftp://",6)) start = pos;
-               }
-
-       if (start<0) return;
-
-       if ((start>0)&&(buf[start-1]=='<')) ench = '>';
-       if ((start>0)&&(buf[start-1]=='[')) ench = ']';
-       if ((start>0)&&(buf[start-1]=='(')) ench = ')';
-       if ((start>0)&&(buf[start-1]=='{')) ench = '}';
-
-       for (pos=strlen(buf); pos>start; --pos) {
-               if ((buf[pos]==' ')||(buf[pos]==ench)) end = pos;
-               }
-
-       strncpy(urlbuf,&buf[start],end-start);
-       urlbuf[end-start] = 0;
-
-
-       strncpy(outbuf,buf,start);
-       sprintf(&outbuf[start],"%cA HREF=%c%s%c TARGET=%c%s%c%c%s%c/A%c", 
-               LB,QU,urlbuf,QU,QU,TARGET,QU,RB,urlbuf,LB,RB);
-       strcat(outbuf,&buf[end]);
-       strcpy(buf,outbuf);
-       }
-
-
-
-
 void getz(char *buf) {
        if (fgets(buf, 256, stdin) == NULL) strcpy(buf, "");
        else {
@@ -606,6 +559,18 @@ fclose(fp);
                do_logout();
                }
 
+       else if (!strcasecmp(action, "readnew")) {
+               readloop("readnew");
+               }
+
+       else if (!strcasecmp(action, "readold")) {
+               readloop("readold");
+               }
+
+       else if (!strcasecmp(action, "readfwd")) {
+               readloop("readfwd");
+               }
+
        /* When all else fails... */
        else {
                printf("HTTP/1.0 200 OK\n");