X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fpaging.c;h=d3319f127f3bebaf891ed073eb5d92ef6a099e82;hb=808f3be91dd6b6677e380695e2f16e6473141a7e;hp=1e6a9e394ce3f3068fce6d8fad6ba79cde9cc639;hpb=c477d6a73cf3afdc47913e2c775ceb5938b6a469;p=citadel.git diff --git a/webcit/paging.c b/webcit/paging.c index 1e6a9e394..d3319f127 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -18,15 +18,14 @@ void display_page(void) strcpy(recp, bstr("recp")); output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n" - "
" - ""); + wprintf("
\n"); + wprintf("

"); wprintf(_("Send instant message")); - wprintf("" - "

\n" - "
\n
\n" - ); - + wprintf(""); + wprintf("
\n"); + + wprintf("
\n"); + wprintf("
" "
\n"); @@ -35,7 +34,8 @@ void display_page(void) wprintf("
\n"); wprintf("
\n"); - wprintf("\n", WC->nonce); + wprintf("\n", WC->nonce); + wprintf("\n"); wprintf("
\n"); @@ -69,7 +69,7 @@ void page_user(void) safestrncpy(recp, bstr("recp"), sizeof recp); - if (IsEmptyStr(bstr("send_button"))) { + if (!havebstr("send_button")) { safestrncpy(WC->ImportantMessage, _("Message was not sent."), sizeof WC->ImportantMessage @@ -81,7 +81,7 @@ void page_user(void) if (buf[0] == '4') { text_to_server(bstr("msgtext")); serv_puts("000"); - stresc(buf, recp, 0, 0); + stresc(buf, 256, recp, 0, 0); snprintf(WC->ImportantMessage, sizeof WC->ImportantMessage, "%s%s.", @@ -94,7 +94,7 @@ void page_user(void) } } - who(); + url_do_template(); } @@ -107,10 +107,13 @@ void do_chat(void) char buf[SIZ]; /** First, check to make sure we're still allowed in this room. */ - serv_printf("GOTO %s", WC->wc_roomname); + serv_printf("GOTO %s", ChrPtr(WC->wc_roomname)); serv_getln(buf, sizeof buf); if (buf[0] != '2') { - smart_goto("_BASEROOM_"); + StrBuf *Buf; + Buf = NewStrBufPlain(HKEY("_BASEROOM_")); + smart_goto(Buf); + FreeStrBuf(&Buf); return; } @@ -129,7 +132,7 @@ void do_chat(void) * output by begin_ajax_response() happen to be the ones we need.) */ begin_ajax_response(); - do_template("chatframeset"); + do_template("chatframeset", NULL); end_ajax_response(); return; } @@ -142,6 +145,7 @@ void do_chat(void) */ void page_popup(void) { + int len; char buf[SIZ]; /** JavaScript function to alert the user that popups are probably blocked */ @@ -158,8 +162,8 @@ void page_popup(void) /** First, do the check as part of our page load. */ serv_puts("NOOP"); - serv_getln(buf, sizeof buf); - if (buf[3] == '*') { + len = serv_getln(buf, sizeof buf); + if ((len >= 3) && (buf[3] == '*')) { if ((time(NULL) - WC->last_pager_check) > 60) { wprintf("