* Added the screens to send pages
authorArt Cancro <ajc@citadel.org>
Fri, 18 Dec 1998 01:38:40 +0000 (01:38 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 18 Dec 1998 01:38:40 +0000 (01:38 +0000)
        * Changed message headers to display in bigger font, non-boldface

webcit/ChangeLog
webcit/Makefile.in
webcit/child.h
webcit/messages.c
webcit/paging.c [new file with mode: 0644]
webcit/webcit.c

index 1af81a198fb28bdc68e4bb26be5bd5309b6ba335..f0af12b20e328efeb318ea76f1483c1c36059cc0 100644 (file)
@@ -1,3 +1,7 @@
+Thu Dec 17 20:38:00 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * Added the screens to send pages
+       * Changed message headers to display in bigger font, non-boldface
+
 Wed Dec 16 16:23:58 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Replace "Citadel/UX" in menu bar with the Citadel/UX logo
 
index 517e946343e58c39d3356e0920fbfb5072884340..83d59bc63afb40c9af157405efd95e16d28400ae 100644 (file)
@@ -35,9 +35,9 @@ snprintf.o: snprintf.c
 
 
 webcit: webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
-       roomops.o tools.o messages.o userlist.o
+       roomops.o tools.o messages.o userlist.o paging.o
        $(CC) webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
-       tools.o roomops.o messages.o userlist.o -o webcit
+       tools.o roomops.o messages.o userlist.o paging.o -o webcit
 
 webcit.o: webcit.c webcit.h child.h
        $(CC) $(CFLAGS) $(DEFS) -c webcit.c
@@ -69,6 +69,9 @@ roomops.o: roomops.c webcit.h child.h
 messages.o: messages.c webcit.h child.h
        $(CC) $(CFLAGS) $(DEFS) -c messages.c
 
+paging.o: paging.c webcit.h child.h
+       $(CC) $(CFLAGS) $(DEFS) -c paging.c
+
 Makefile: $(srcdir)/Makefile.in config.status
        CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
 
index 1055037774a9f8735f947d4173104121588840af..c7cffc1c804bf74e96f782adac0f1ff0d85c8733 100644 (file)
@@ -50,3 +50,5 @@ void confirm_move_msg(void);
 void move_msg(void);
 void userlist(void);
 void showuser(void);
+void display_page(void);
+void page_user(void);
index 9f767dae4452dda49114d0d93b4065fcf8197659..da7a3bb5fc7bde76c455fa04c697d446e98a270e 100644 (file)
@@ -77,7 +77,7 @@ char *oper; {
                }
 
        wprintf("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=000077><TR><TD>\n");
-       wprintf("<FONT COLOR=\"FFFF00\"><B> ");
+       wprintf("<FONT SIZE=+1 COLOR=\"FFFF00\"> ");
        strcpy(m_subject,"");
 
        strcpy(reply_to,"nobody...xxxxx");
@@ -130,7 +130,7 @@ char *oper; {
                }
 
        if (nhdr==1) wprintf("****");
-       wprintf("</B></FONT></TD>");
+       wprintf("</FONT></TD>");
        
        if (is_room_aide) {
                wprintf("<TD ALIGN=RIGHT NOWRAP><FONT COLOR=\"FFFF00\"><B>");
diff --git a/webcit/paging.c b/webcit/paging.c
new file mode 100644 (file)
index 0000000..7bd2ebc
--- /dev/null
@@ -0,0 +1,98 @@
+/* $Id$ */
+
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <string.h>
+#include "webcit.h"
+#include "child.h"
+
+/*
+ * display the form for paging (x-messaging) another user
+ */
+void display_page(void) {
+       char buf[256];
+       char user[256];
+
+        printf("HTTP/1.0 200 OK\n");
+        output_headers(1);
+
+        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
+        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+        wprintf("<B>Page another user</B>\n");
+        wprintf("</FONT></TD></TR></TABLE>\n");
+
+       wprintf("This command sends a near-real-time message to any currently\n");
+       wprintf("logged in user.<BR><BR>\n");
+
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/page_user\">\n");
+
+       wprintf("Select a user to send a message to: <BR>");
+
+       wprintf("<SELECT NAME=\"recp\" SIZE=10>\n");
+       serv_puts("RWHO");
+       serv_gets(buf);
+       if (buf[0]=='1') {
+               while(serv_gets(buf), strcmp(buf,"000")) {
+                       extract(user,buf,1);
+                       wprintf("<OPTION>");
+                       escputs(user);
+                       wprintf("\n");
+                       }
+               }
+       wprintf("</SELECT>\n");
+       wprintf("<BR>\n");
+
+       wprintf("Enter message text:<BR>");
+       wprintf("<INPUT TYPE=\"text\" NAME=\"msgtext\" MAXLENGTH=80 SIZE=80>\n");
+       wprintf("<BR><BR>\n");
+
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send message\">");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
+
+       wprintf("</FORM></CENTER>\n");
+        wprintf("</BODY></HTML>\n");
+        wDumpContent();
+       }
+
+/*
+ * page another user
+*/
+void page_user(void) {
+       char recp[256];
+       char msgtext[256];
+       char sc[256];
+       char buf[256];
+       
+        printf("HTTP/1.0 200 OK\n");
+        output_headers(1);
+
+       strcpy(recp,bstr("recp"));
+       strcpy(msgtext,bstr("msgtext"));
+       strcpy(sc,bstr("sc"));
+
+       if (strcmp(sc,"Send message")) {
+               wprintf("<EM>Message was not sent.</EM><BR>\n");
+               return;
+               }
+
+       serv_printf("SEXP %s|%s",recp,msgtext);
+       serv_gets(buf); 
+
+       if (buf[0] == '2') {
+               wprintf("<EM>Message has been sent to ");
+               escputs(recp);
+               wprintf(".</EM><BR>\n");
+               }
+       else {
+               wprintf("<EM>%s</EM><BR>\n",&buf[4]);
+               }
+
+        wprintf("</BODY></HTML>\n");
+        wDumpContent();
+       }
index 1df6854caf9b19806ec7e9c8f2b3cd09b35e0039..b879c097d7e5af51cabe80cbddb1443218624045 100644 (file)
@@ -656,6 +656,14 @@ fclose(fp);
                showuser();
                }
 
+       else if (!strcasecmp(action, "display_page")) {
+               display_page();
+               }
+
+       else if (!strcasecmp(action, "page_user")) {
+               page_user();
+               }
+
        /* When all else fails... */
        else {
                printf("HTTP/1.0 200 OK\n");