-
-/*
- * multiuser chat
- */
-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_gets(buf);
- if (buf[0] != '2') {
- smart_goto("_BASEROOM_");
- return;
- }
-
- /* If the chat socket is still open from a previous chat,
- * close it -- because it might be stale or in the wrong room.
- */
- if (WC->chat_sock < 0) {
- close(WC->chat_sock);
- WC->chat_sock = (-1);
- }
-
- /* WebCit Chat works by having transmit, receive, and refresh
- * frames. Load the frameset.
- */
- do_template("chatframeset");
- return;
-}
-
-
-/*
- *
- */
-void page_popup(void)
-{
- char buf[SIZ];
- char pagefrom[SIZ];
-
- /* suppress express message check, do headers but no frames */
- output_headers(0x08 | 0x03);
-
- while (serv_puts("GEXP"), serv_gets(buf), buf[0]=='1') {
-
- extract(pagefrom, &buf[4], 3);
-
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
- wprintf("<SPAN CLASS=\"titlebar\">Instant message from ");
- escputs(pagefrom);
- wprintf("</SPAN></TD></TR></TABLE>\n");
-
- fmout(NULL, "LEFT");
- }
-
- wprintf("<CENTER>");
- wprintf("<A HREF=\"/display_page&closewin=yes&recp=");
- urlescputs(pagefrom);
- wprintf("\">[ reply ]</A> \n");
-
- wprintf("<A HREF=\"javascript:window.close();\">"
- "[ close window ]</A></B>\n"
- "</CENTER>");
-
- wDumpContent(1);
- WC->HaveExpressMessages = 0;
-}
-
-
-
-/*
- * Support function for chat -- make sure the chat socket is connected
- * and in chat mode.
- */
-int setup_chat_socket(void) {
+// display page popup
+// If there are instant messages waiting, and we notice that we haven't checked them in
+// a while, it probably means that we need to open the instant messenger window.
+int Conditional_PAGE_WAITING(StrBuf *Target, WCTemplputParams *TP) {
+ int len;