$Log$
+ Revision 590.79 2002/01/20 08:03:43 error
+ * curses client: use the status line as "input" line in chat mode
+
Revision 590.78 2002/01/20 07:43:07 error
* serv_chat.c: Server no longer crashes when CHATLOG can't be opened
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
strcpy(buf, "");
strcpy(wbuf, "");
color(BRIGHT_YELLOW);
- scr_printf("> ");
+ sln_printf_if("\n");
+ sln_printf("> ");
send_complete_line = 0;
recv_complete_line = 0;
while (1) {
- fflush(stdout);
+ sln_flush();
FD_ZERO(&rfds);
FD_SET(0, &rfds);
FD_SET(getsockfd(), &rfds);
goto RCL;
}
if (FD_ISSET(0, &rfds)) {
- ch = inkey();
+ ch = scr_getc();
if ((ch == 10) || (ch == 13)) {
send_complete_line = 1;
} else if ((ch == 8) || (ch == 127)) {
if (strlen(wbuf) > 0) {
wbuf[strlen(wbuf) - 1] = 0;
- scr_printf("%c %c", 8, 8);
+ sln_printf("%c %c", 8, 8);
}
} else {
- putc(ch, stdout);
+ sln_putc(ch);
wbuf[strlen(wbuf) + 1] = 0;
wbuf[strlen(wbuf)] = ch;
}
}
}
if (recv_complete_line) {
- scr_printf("\r%79s\r", "");
+ sln_printf("\r%79s\r", "");
if (!strcmp(buf, "000")) {
color(BRIGHT_WHITE);
- scr_printf("Exiting chat mode\n");
-
- scr_flush();
+ sln_printf("\rExiting chat mode\n");
+ sln_flush();
set_keepalives(KA_YES);
-
/* Some users complained about the client and server
* losing protocol synchronization when exiting chat.
* This little dialog forces everything to be
while (strlen(buf) < 79)
strcat(buf, " ");
if (strcmp(c_user, last_user)) {
- scr_printf("\r%79s\n", "");
+ sln_printf("\r%79s\n", "");
strcpy(last_user, c_user);
}
scr_printf("\r%s\n", buf);
- fflush(stdout);
+ scr_flush();
}
}
color(BRIGHT_YELLOW);
- scr_printf("> %s", wbuf);
+ sln_printf("\r> %s", wbuf);
+ sln_flush();
recv_complete_line = 0;
strcpy(buf, "");
}
void connection_died(void) {
+#ifdef CIT_CLIENT
+ screen_delete();
+#endif
err_printf("\rYour connection to this Citadel server is broken.\n"
"Please re-connect and log in again.\n");
logoff(3);
#ifdef HAVE_CURSES_H
if (mainwindow) {
retval = _vwprintw(mainwindow, fmt, ap);
- /*
- if (fmt[strlen(fmt) - 1] == '\n')
- wrefresh(mainwindow);
- */
} else
#endif
retval = vprintf(fmt, ap);
if (*i == '\r' || *i == '\n')
wclrtoeol(statuswindow);
sln_putc(*i);
- if (*i == '\r' || *i == '\n')
+ if (*i == '\r' || *i == '\n') {
+ wrefresh(statuswindow);
mvwinch(statuswindow, 0, 0);
+ }
}
} else
#endif
if (*i == '\r' || *i == '\n')
wclrtoeol(statuswindow);
sln_putc(*i);
- if (*i == '\r' || *i == '\n')
+ if (*i == '\r' || *i == '\n') {
+ wrefresh(statuswindow);
mvwinch(statuswindow, 0, 0);
+ }
}
}
va_end(ap);
statuswindow = newwin(1, x, y - 1, 0);
wbkgdset(statuswindow, COLOR_PAIR(17));
werase(statuswindow);
- immedok(statuswindow, TRUE);
+ immedok(statuswindow, FALSE);
leaveok(statuswindow, FALSE);
scrollok(statuswindow, FALSE);
wrefresh(statuswindow);