From 77ae5dcd072fc84b6a5e889283e8cf5becbdfa64 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 18 Dec 1998 01:38:40 +0000 Subject: [PATCH] * Added the screens to send pages * Changed message headers to display in bigger font, non-boldface --- webcit/ChangeLog | 4 ++ webcit/Makefile.in | 7 +++- webcit/child.h | 2 + webcit/messages.c | 4 +- webcit/paging.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++ webcit/webcit.c | 8 ++++ 6 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 webcit/paging.c diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 1af81a198..f0af12b20 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,3 +1,7 @@ +Thu Dec 17 20:38:00 EST 1998 Art Cancro + * 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 * Replace "Citadel/UX" in menu bar with the Citadel/UX logo diff --git a/webcit/Makefile.in b/webcit/Makefile.in index 517e94634..83d59bc63 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -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 diff --git a/webcit/child.h b/webcit/child.h index 105503777..c7cffc1c8 100644 --- a/webcit/child.h +++ b/webcit/child.h @@ -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); diff --git a/webcit/messages.c b/webcit/messages.c index 9f767dae4..da7a3bb5f 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -77,7 +77,7 @@ char *oper; { } wprintf(""); + wprintf(""); if (is_room_aide) { wprintf("
\n"); - wprintf(" "); + wprintf(" "); strcpy(m_subject,""); strcpy(reply_to,"nobody...xxxxx"); @@ -130,7 +130,7 @@ char *oper; { } if (nhdr==1) wprintf("****"); - wprintf(""); diff --git a/webcit/paging.c b/webcit/paging.c new file mode 100644 index 000000000..7bd2ebc9b --- /dev/null +++ b/webcit/paging.c @@ -0,0 +1,98 @@ +/* $Id$ */ + +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include +#include +#include +#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("
"); + wprintf("Page another user\n"); + wprintf("
\n"); + + wprintf("This command sends a near-real-time message to any currently\n"); + wprintf("logged in user.

\n"); + + wprintf("
\n"); + + wprintf("Select a user to send a message to:
"); + + wprintf("\n"); + wprintf("
\n"); + + wprintf("Enter message text:
"); + wprintf("\n"); + wprintf("

\n"); + + wprintf(""); + wprintf("
\n"); + + wprintf("
\n"); + wprintf("\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("Message was not sent.
\n"); + return; + } + + serv_printf("SEXP %s|%s",recp,msgtext); + serv_gets(buf); + + if (buf[0] == '2') { + wprintf("Message has been sent to "); + escputs(recp); + wprintf(".
\n"); + } + else { + wprintf("%s
\n",&buf[4]); + } + + wprintf("\n"); + wDumpContent(); + } diff --git a/webcit/webcit.c b/webcit/webcit.c index 1df6854ca..b879c097d 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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"); -- 2.39.2