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)
34 strcpy(recp, bstr("recp"));
38 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
39 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
40 wprintf("<B>Page another user</B>\n");
41 wprintf("</FONT></TD></TR></TABLE>\n");
43 wprintf("This command sends a near-real-time message to any currently\n");
44 wprintf("logged in user.<BR><BR>\n");
46 wprintf("<FORM METHOD=\"POST\" ACTION=\"/page_user\">\n");
49 wprintf("<TABLE border=0 width=100%%><TR><TD>\n");
51 wprintf("Select a user to send a message to: <BR>");
53 wprintf("<SELECT NAME=\"recp\" SIZE=10>\n");
57 while (serv_gets(buf), strcmp(buf, "000")) {
58 extract(user, buf, 1);
61 if (!strcmp(user, recp)) {
70 wprintf("</SELECT>\n");
74 wprintf("Enter message text:<BR>");
76 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=5 COLS=40 "
77 "WIDTH=40></TEXTAREA><P>\n");
79 wprintf("</TD></TR></TABLE><BR>\n");
81 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send message\">");
82 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
84 wprintf("</FORM></CENTER>\n");
99 strcpy(recp, bstr("recp"));
100 strcpy(sc, bstr("sc"));
102 if (strcmp(sc, "Send message")) {
103 wprintf("<EM>Message was not sent.</EM><BR>\n");
105 serv_printf("SEXP %s|-", recp);
109 text_to_server(bstr("msgtext"));
111 wprintf("<EM>Message has been sent to ");
113 wprintf(".</EM><BR>\n");
116 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
132 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
133 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
134 wprintf("<B>Real-time chat</B>\n");
135 wprintf("</FONT></TD></TR></TABLE>\n");
137 wprintf("A chat window should be appearing on your screen ");
138 wprintf("momentarily. When you're ");
139 wprintf("done, type <TT>/quit</TT> to exit. You can also ");
140 wprintf("type <TT>/help</TT> for more commands.\n");
142 wprintf("<applet codebase=\"/static\" ");
143 wprintf("code=\"wcchat\" width=2 height=2>\n");
144 wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
145 wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
146 wprintf("<PARAM NAME=roomname VALUE=\"%s\">\n", WC->wc_roomname);
147 wprintf("<H2>Oops!</H2>Looks like your browser doesn't support Java, ");
148 wprintf("so you won't be able to access Chat. Sorry.\n");
149 wprintf("</applet>\n");
157 void page_popup(void)
162 /* suppress express message check, do headers but no fake frames */
163 output_headers(0x08 | 0x03);
165 while (serv_puts("GEXP"), serv_gets(buf), buf[0]=='1') {
167 extract(pagefrom, &buf[4], 3);
169 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
170 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\""
171 "<B>Express message from ");
173 wprintf("</B></FONT></TD></TR></TABLE>\n");
179 "<A HREF=\"javascript:window.close();\">"
180 "[ close window ]</A></B>\n"
184 WC->HaveExpressMessages = 0;