]> code.citadel.org Git - citadel.git/commitdiff
* A real status line for the text client
authorMichael Hampton <io_error@uncensored.citadel.org>
Sat, 19 Jan 2002 11:59:34 +0000 (11:59 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sat, 19 Jan 2002 11:59:34 +0000 (11:59 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/client_crypto.c
citadel/screen.c
citadel/screen.h

index 9ee89cbe002bc18e5fbfa3fdb6cb7c8eaab10a65..bb7b159fd5adde9e9089833f482661440f9184dd 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.74  2002/01/19 11:59:33  error
+ * A real status line for the text client
+
  Revision 590.73  2002/01/19 10:08:43  error
  * fix link for libcitserver.so to tools.o which I broke (oops!)
 
@@ -3194,3 +3197,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 5340ffc72456a1a836bb79cdca0aa594ba5cb362..ed587f6d822f702c20f81be30de58b410a09e1c7 100644 (file)
@@ -108,6 +108,7 @@ char curr_floor = 0;                /* number of current floor */
 char floorlist[128][SIZ];      /* names of floors */
 char express_msgs = 0;         /* express messages waiting! */
 int termn8 = 0;                        /* Set to nonzero to cause a logoff */
+int secure;                    /* Set to nonzero when wire is encrypted */
 
 extern int rc_ansi_color;      /* ansi color value from citadel.rc */
 
@@ -322,7 +323,7 @@ void dotgoto(char *towhere, int display_name)
 {
        char aaa[SIZ], bbb[SIZ], psearch[SIZ];
        static long ls = 0L;
-       int newmailcount;
+       int newmailcount = 0;
        static int oldmailcount = (-1);
        int partial_match, best_match;
        char from_floor;
@@ -437,6 +438,18 @@ void dotgoto(char *towhere, int display_name)
                        color(DIM_WHITE);
                }
                oldmailcount = newmailcount;
+               sln_printf_if("%s at %s in %s | %s | %d unread mail\n",
+                               serv_info.serv_humannode,
+                               serv_info.serv_bbs_city,
+                               room_name,
+                               secure ? "Secure" : "Not secure",
+                               newmailcount);
+       } else {
+               sln_printf_if("%s at %s in %s | %s\n",
+                               serv_info.serv_humannode,
+                               serv_info.serv_bbs_city,
+                               room_name,
+                               secure ? "Secure" : "Not secure");
        }
 }
 
@@ -1007,12 +1020,15 @@ int main(int argc, char **argv)
 
        get_serv_info(telnet_client_host);
 
-       if (!starttls()) {
-               sln_printf("Session will not be encrypted.\n");
-       }
-
        scr_printf("%-24s\n%s\n%s\n", serv_info.serv_software, serv_info.serv_humannode,
                serv_info.serv_bbs_city);
+       scr_flush();
+
+       secure = starttls();
+       sln_printf_if("%s at %s | %s\n",
+                       serv_info.serv_humannode,
+                       serv_info.serv_bbs_city,
+                       secure ? "Secure" : "Not secure");
 
        screenwidth = 80;       /* default screen dimensions */
        screenheight = 24;
index 73b58658b8773916503ee56f6b05b1a3f9f6301b..cede2835a8237b15c858de94ebc79d5ec089b111 100644 (file)
@@ -274,7 +274,7 @@ int starttls(void)
                int bits, alg_bits;
 
                bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &alg_bits);
-               sln_printf("Encrypting with %s cipher %s (%d of %d bits)\n",
+               err_printf("Encrypting with %s cipher %s (%d of %d bits)\n",
                                SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)),
                                SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)),
                                bits, alg_bits);
index 7d930f4416fa4e0218f9f2f817068b4f7adf193f..65305e7b9b8a8dff04b2699c57959ff8b2ece92d 100644 (file)
@@ -196,6 +196,30 @@ int sln_printf(char *fmt, ...)
 }
 
 
+/*
+ * sln_printf_if() outputs to status window, no output if not in curses
+ */
+int sln_printf_if(char *fmt, ...)
+{
+       register int retval = 1;
+#ifdef HAVE_CURSES_H
+       va_list ap;
+
+       va_start(ap, fmt);
+       if (statuswindow) {
+               retval = _vwprintw(statuswindow, fmt, ap);
+               if (fmt[strlen(fmt) - 1] == '\r' ||
+                   fmt[strlen(fmt) - 1] == '\n') {
+                       mvwinch(statuswindow, 0, 0);
+                       wrefresh(mainwindow);
+               }
+       }
+       va_end(ap);
+#endif
+       return retval;
+}
+
+
 int scr_getc(void)
 {
 #ifdef HAVE_CURSES_H
index 0eb69ad44f482bf982d6da18b49c1bfcb4ba2e7f..ac35f0e78a361d28591e06f435db0d39c182b4b7 100644 (file)
@@ -7,6 +7,7 @@ int screen_reset(void);
 int scr_printf(char *fmt, ...);
 int err_printf(char *fmt, ...);
 int sln_printf(char *fmt, ...);
+int sln_printf_if(char *fmt, ...);
 int scr_getc(void);
 int scr_putc(int c);
 int scr_color(int colornum);