* client_chat.c: display "No message sent" if a send page is aborted.
authorArt Cancro <ajc@citadel.org>
Wed, 29 Dec 1999 04:44:00 +0000 (04:44 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 29 Dec 1999 04:44:00 +0000 (04:44 +0000)
  Closes bug #2 in bugzilla.

citadel/ChangeLog
citadel/client_chat.c

index 042f1621b7af2ada96b802c4cd9cfe44a5c1dda1..96b1af234c02b3aa3c12694f22e67c3857e71072 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 1.433  1999/12/29 04:44:00  ajc
+* client_chat.c: display "No message sent" if a send page is aborted.
+  Closes bug #2 in bugzilla.
+
 Revision 1.432  1999/12/26 21:50:07  ajc
 * serv_vcard: don't run hooks when not logged in (such as in SMTP sessions)
 * serv_pop3: added.  This is the skeleton for a module implementing POP3.
@@ -1507,3 +1511,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
 
+
index a8c05180782185865cdea8eaf5c072d221870a35..217193d781d9300620c455cd1303db12bfa17520 100644 (file)
@@ -235,22 +235,28 @@ void page_user() {
                pagefp = fopen(temp, "w+");
                unlink(temp);
                citedit(pagefp, 0L);
-               rewind(pagefp);
-               snprintf(buf, sizeof buf, "SEXP %s|-", touser);
-               serv_puts(buf);
-               serv_gets(buf);
-               if (buf[0]=='4') {
-                       strcpy(last_paged, touser);
-                       while (fgets(buf, 256, pagefp) != NULL) {
-                               buf[strlen(buf)-1] = 0;
-                               serv_puts(buf);
-                               }
-                       fclose(pagefp);
-                       serv_puts("000");
-                       printf("Message sent.\n");
-               }
+               fseek(pagefp, 0L, SEEK_END);
+               if ( ftell(pagefp) > 2)  {
+                       rewind(pagefp);
+                       snprintf(buf, sizeof buf, "SEXP %s|-", touser);
+                       serv_puts(buf);
+                       serv_gets(buf);
+                       if (buf[0]=='4') {
+                               strcpy(last_paged, touser);
+                               while (fgets(buf, 256, pagefp) != NULL) {
+                                       buf[strlen(buf)-1] = 0;
+                                       serv_puts(buf);
+                                       }
+                               fclose(pagefp);
+                               serv_puts("000");
+                               printf("Message sent.\n");
+                       }
+                       else {
+                               printf("%s\n", &buf[4]);
+                       }
+               } 
                else {
-                       printf("%s\n", &buf[4]);
+                       printf("No message sent.\n");
                }
        }
 }