X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fpaging.c;h=d44c816cb2327d4101acc869afb87b93c8583985;hb=a5a4785d48a744be30ce261bea0c59ef9718585f;hp=1bc28e4883a65e2de830516dd0661dd1d2cdc892;hpb=26a4a07bdacdaa7013bf45cc235df207708acfde;p=citadel.git diff --git a/webcit/paging.c b/webcit/paging.c index 1bc28e488..d44c816cb 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -1,15 +1,11 @@ /* * $Id$ */ -/** - * \defgroup PageFunc Functions which implement the chat and paging facilities. - * \ingroup ClientPower - */ -/*@{*/ + #include "webcit.h" -/** - * \brief display the form for paging (x-messaging) another user +/* + * display the form for paging (x-messaging) another user */ void display_page(void) { @@ -18,23 +14,24 @@ 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"); + "
\n"); wprintf(_("Send an instant message to: ")); escputs(recp); wprintf("
\n"); wprintf("
\n"); + wprintf("\n", WC->nonce); + wprintf("\n"); wprintf("
\n"); @@ -68,7 +65,7 @@ void page_user(void) safestrncpy(recp, bstr("recp"), sizeof recp); - if (strlen(bstr("send_button")) == 0) { + if (!havebstr("send_button")) { safestrncpy(WC->ImportantMessage, _("Message was not sent."), sizeof WC->ImportantMessage @@ -80,7 +77,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.", @@ -93,7 +90,7 @@ void page_user(void) } } - who(); + url_do_template(); } @@ -106,10 +103,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; } @@ -128,7 +128,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; } @@ -141,6 +141,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 */ @@ -157,8 +158,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("