11 #include <sys/socket.h>
14 #include <netinet/in.h>
26 * display the form for paging (x-messaging) another user
28 void display_page(void)
35 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
36 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
37 wprintf("<B>Page another user</B>\n");
38 wprintf("</FONT></TD></TR></TABLE>\n");
40 wprintf("This command sends a near-real-time message to any currently\n");
41 wprintf("logged in user.<BR><BR>\n");
43 wprintf("<FORM METHOD=\"POST\" ACTION=\"/page_user\">\n");
46 wprintf("<TABLE border=0 width=100%%><TR><TD>\n");
48 wprintf("Select a user to send a message to: <BR>");
50 wprintf("<SELECT NAME=\"recp\" SIZE=10>\n");
54 while (serv_gets(buf), strcmp(buf, "000")) {
55 extract(user, buf, 1);
61 wprintf("</SELECT>\n");
65 wprintf("Enter message text:<BR>");
67 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=5 COLS=40 "
68 "WIDTH=40></TEXTAREA><P>\n");
70 wprintf("</TD></TR></TABLE><BR>\n");
72 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send message\">");
73 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
75 wprintf("</FORM></CENTER>\n");
90 strcpy(recp, bstr("recp"));
91 strcpy(sc, bstr("sc"));
93 if (strcmp(sc, "Send message")) {
94 wprintf("<EM>Message was not sent.</EM><BR>\n");
96 serv_printf("SEXP %s|-", recp);
100 text_to_server(bstr("msgtext"));
102 wprintf("<EM>Message has been sent to ");
104 wprintf(".</EM><BR>\n");
107 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
123 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
124 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
125 wprintf("<B>Real-time chat</B>\n");
126 wprintf("</FONT></TD></TR></TABLE>\n");
128 wprintf("A chat window should be appearing on your screen ");
129 wprintf("momentarily. When you're ");
130 wprintf("done, type <TT>/quit</TT> to exit. You can also ");
131 wprintf("type <TT>/help</TT> for more commands.\n");
133 wprintf("<applet codebase=\"/static\" ");
134 wprintf("code=\"wcchat\" width=2 height=2>\n");
135 wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
136 wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
137 wprintf("<PARAM NAME=roomname VALUE=\"%s\">\n", WC->wc_roomname);
138 wprintf("<H2>Oops!</H2>Looks like your browser doesn't support Java, ");
139 wprintf("so you won't be able to access Chat. Sorry.\n");
140 wprintf("</applet>\n");
148 void page_popup(void)
153 /* suppress express message check, do headers but no fake frames */
154 output_headers(0x08 | 0x03);
156 while (serv_puts("GEXP"), serv_gets(buf), buf[0]=='1') {
158 extract(pagefrom, &buf[4], 3);
160 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
161 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\""
162 "<B>Express message from ");
164 wprintf("</B></FONT></TD></TR></TABLE>\n");
170 "<A HREF=\"javascript:window.close();\">"
171 "[ close window ]</A></B>\n"
175 WC->HaveExpressMessages = 0;