- output_headers(1);
-
- wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
- wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
- wprintf("<B>Real-time chat</B>\n");
- wprintf("</FONT></TD></TR></TABLE>\n");
-
- wprintf("A chat window should be appearing on your screen ");
- wprintf("momentarily. When you're ");
- wprintf("done, type <TT>/quit</TT> to exit. You can also ");
- wprintf("type <TT>/help</TT> for more commands.\n");
-
- wprintf("<applet codebase=\"/static\" ");
- wprintf("code=\"wcchat\" width=2 height=2>\n");
- wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
- wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
- wprintf("<PARAM NAME=roomname VALUE=\"%s\">\n", WC->wc_roomname);
- wprintf("<H2>Oops!</H2>Looks like your browser doesn't support Java, ");
- wprintf("so you won't be able to access Chat. Sorry.\n");
- wprintf("</applet>\n");
- wDumpContent(1);
+
+void ajax_send_instant_message(void) {
+ char recp[256];
+ char buf[256];
+
+ safestrncpy(recp, bstr("recp"), sizeof recp);
+
+ serv_printf("SEXP %s|-", recp);
+ serv_getln(buf, sizeof buf);
+
+ if (buf[0] == '4') {
+ text_to_server(bstr("msg"));
+ serv_puts("000");
+ }
+
+ escputs(buf); /* doesn't really matter what we return - the client ignores it */
+}
+
+
+void
+InitModule_PAGING
+(void)
+{
+ WebcitAddUrlHandler(HKEY("display_page"), "", 0, display_page, 0);
+ WebcitAddUrlHandler(HKEY("page_user"), "", 0, page_user, 0);
+ WebcitAddUrlHandler(HKEY("ajax_send_instant_message"), "", 0, ajax_send_instant_message, AJAX);
+ RegisterConditional(HKEY("COND:PAGE:WAITING"), 0, Conditional_PAGE_WAITING, CTX_NONE);
+}
+
+
+void
+SessionDestroyModule_PAGING
+(wcsession *sess)
+{
+ /* nothing here anymore */