From 29dbd58d9c94d3cc55279218af286e05f6f06856 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 15 Mar 2004 04:27:44 +0000 Subject: [PATCH] * Chat now appears in a separate window * Use regular frames instead of IFRAMEs for chat * Display user's own chat text in bold+italic * Added a "List Users" button --- webcit/ChangeLog | 7 +++++++ webcit/iconbar.c | 2 +- webcit/mainmenu.c | 2 +- webcit/paging.c | 39 ++++++++++++++++++++++++++++++++++----- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 1c377bc14..ba157ea5a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,10 @@ $Log$ +Revision 505.15 2004/03/15 04:27:44 ajc +* Chat now appears in a separate window +* Use regular frames instead of IFRAMEs for chat +* Display user's own chat text in bold+italic +* Added a "List Users" button + Revision 505.14 2004/03/09 20:45:45 error * Add a Linux Software Map file @@ -1718,3 +1724,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/iconbar.c b/webcit/iconbar.c index c3adb4ed2..1dde97204 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -202,7 +202,7 @@ void do_iconbar(void) { "" ); if (ib_displayas != IB_TEXTONLY) { diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index e8e07fbf5..d2c4f65f4 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -144,7 +144,7 @@ void display_main_menu(void) wprintf("" "" "Chat with other users in " diff --git a/webcit/paging.c b/webcit/paging.c index cbfdd7acc..b3d4b1777 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -338,11 +338,18 @@ void chat_recv(void) { extract_token(cl_text, buf, 1, '|'); wprintf("parent.chat_transcript.document.write('"); - wprintf(""); + wprintf(""); + wprintf(""); + if (!strcasecmp(cl_user, WC->wc_username)) { + wprintf(""); + } jsescputs(cl_user); - wprintf(": "); + wprintf(": "); + if (strcasecmp(cl_user, WC->wc_username)) { + wprintf(""); + } jsescputs(cl_text); - wprintf("
"); + wprintf("

"); wprintf("'); \n"); } @@ -362,6 +369,7 @@ void chat_recv(void) { void chat_send(void) { int i; char send_this[SIZ]; + char buf[SIZ]; output_headers(0); wprintf("Content-type: text/html\n"); @@ -383,6 +391,10 @@ void chat_send(void) { strcpy(send_this, "/help"); } + if (!strcasecmp(bstr("sendbutton"), "List Users")) { + strcpy(send_this, "/who"); + } + if (!strcasecmp(bstr("sendbutton"), "Exit")) { strcpy(send_this, "/quit"); } @@ -398,7 +410,21 @@ void chat_send(void) { WC->serv_sock = WC->chat_sock; WC->chat_sock = i; - serv_puts(send_this); + while (strlen(send_this) > 0) { + if (strlen(send_this) < 72) { + serv_puts(send_this); + strcpy(send_this, ""); + } + else { + for (i=60; i<72; ++i) { + if (send_this[i] == ' ') break; + } + strncpy(buf, send_this, i); + buf[i] = 0; + strcpy(send_this, &send_this[i]); + serv_puts(buf); + } + } /* Unswap the sockets. */ i = WC->serv_sock; @@ -408,9 +434,12 @@ void chat_send(void) { } wprintf("
\n"); - wprintf("\n"); + wprintf("\n", SIZ-10); + wprintf("
"); wprintf("\n"); wprintf("\n"); + wprintf("\n"); wprintf("\n"); wprintf("
\n"); -- 2.39.2