X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fpaging.c;h=c202b3e7b6e3704315908190683b3d64263219f7;hb=aa8ca3b0af3efdabd8559b886efb3164319bdce1;hp=bc3fc936ea56f112423abb1d5e4d0c410a3888a3;hpb=14369bba1cc9d3dc85357ea9d64333b332703193;p=citadel.git diff --git a/webcit/paging.c b/webcit/paging.c index bc3fc936e..c202b3e7b 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -4,29 +4,8 @@ * Functions which implement the chat and paging facilities. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "webcit.h" - /* * display the form for paging (x-messaging) another user */ @@ -104,7 +83,7 @@ void page_user(void) wprintf("Message was not sent.
\n"); } else { serv_printf("SEXP %s|-", recp); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '4') { text_to_server(bstr("msgtext"), 0); @@ -137,7 +116,7 @@ void do_chat(void) /* First, check to make sure we're still allowed in this room. */ serv_printf("GOTO %s", WC->wc_roomname); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] != '2') { smart_goto("_BASEROOM_"); return; @@ -167,9 +146,9 @@ void page_popup(void) char buf[SIZ]; char pagefrom[SIZ]; - while (serv_puts("GEXP"), serv_gets(buf), buf[0]=='1') { + while (serv_puts("GEXP"), serv_getln(buf, sizeof buf), buf[0]=='1') { - extract(pagefrom, &buf[4], 3); + extract_token(pagefrom, &buf[4], 3, '|', sizeof pagefrom); wprintf("
"); wprintf("Instant message from "); @@ -219,19 +198,19 @@ int setup_chat_socket(void) { WC->serv_sock = WC->chat_sock; WC->chat_sock = i; - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '2') { serv_printf("USER %s", WC->wc_username); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '3') { serv_printf("PASS %s", WC->wc_password); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '2') { serv_printf("GOTO %s", WC->wc_roomname); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '2') { serv_puts("CHAT"); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '8') { good_chatmode = 1; } @@ -268,10 +247,9 @@ void chat_recv(void) { char cl_text[SIZ]; char *output_data = NULL; - lprintf(9, "chat_recv() called\n"); output_headers(0, 0, 0, 0, 0, 0, 0); - wprintf("Content-type: text/html\n"); + wprintf("Content-type: text/html; charset=utf-8\n"); wprintf("\n"); wprintf("\n" "\n" @@ -304,7 +282,7 @@ void chat_recv(void) { WC->serv_sock = WC->chat_sock; WC->chat_sock = i; - serv_gets(buf); + serv_getln(buf, sizeof buf); if (!strcmp(buf, "000")) { strcpy(buf, ":|exiting chat mode"); @@ -325,7 +303,6 @@ void chat_recv(void) { } while ( (got_data) && (!end_chat_now) ); if (end_chat_now) { - lprintf(9, "exiting chat\n"); close(WC->chat_sock); WC->chat_sock = (-1); wprintf("\n"); @@ -338,15 +315,14 @@ void chat_recv(void) { } /* Output our fun to the other frame. */ - lprintf(9, "output to other frame\n"); wprintf("\n"); - lprintf(9, "done fun\n"); } free(output_data); @@ -419,7 +394,7 @@ void chat_send(void) { char buf[SIZ]; output_headers(0, 0, 0, 0, 0, 0, 0); - wprintf("Content-type: text/html\n"); + wprintf("Content-type: text/html; charset=utf-8\n"); wprintf("\n"); wprintf("" ""