From 7b4b6412a21fdbf7462bcfc8e017bc17e6fe8543 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 16 Dec 2005 04:51:46 +0000 Subject: [PATCH] * Checkbox to allow anonymous posting in rooms which allow it. Resolves bugzilla #65. --- webcit/ChangeLog | 4 ++++ webcit/messages.c | 25 ++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 81e03313b..9df400914 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,5 +1,9 @@ $Id$ +Thu Dec 15 23:50:45 EST 2005 ajc +* Checkbox to allow anonymous posting in rooms which allow it. + Resolves bugzilla #65. + Thu Dec 15 17:35:47 EST 2005 ajc * "Headers" option in view message diff --git a/webcit/messages.c b/webcit/messages.c index e639c71e3..038711622 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -2366,6 +2366,11 @@ void post_message(void) char buf[SIZ]; static long dont_post = (-1L); struct wc_attachment *att, *aptr; + int is_anonymous = 0; + + if (!strcasecmp(bstr("is_anonymous"), "yes")) { + is_anonymous = 1; + } if (WC->upload_length > 0) { @@ -2419,8 +2424,9 @@ void post_message(void) _("Automatically cancelled because you have already " "saved this message.")); } else { - sprintf(buf, "ENT0 1|%s|0|4|%s|||%s|%s", + sprintf(buf, "ENT0 1|%s|%d|4|%s|||%s|%s", bstr("recp"), + is_anonymous, bstr("subject"), bstr("cc"), bstr("bcc") @@ -2465,11 +2471,16 @@ void display_enter(void) int recipient_required = 0; int recipient_bad = 0; int i; + int is_anonymous = 0; if (strlen(bstr("force_room")) > 0) { gotoroom(bstr("force_room")); } + if (!strcasecmp(bstr("is_anonymous"), "yes")) { + is_anonymous = 1; + } + /* Are we perhaps in an address book view? If so, then an "enter * message" command really means "add new entry." */ @@ -2521,7 +2532,7 @@ void display_enter(void) /* Now check our actual recipients if there are any */ if (recipient_required) { - sprintf(buf, "ENT0 0|%s|0|0||||%s|%s", bstr("recp"), bstr("cc"), bstr("bcc")); + sprintf(buf, "ENT0 0|%s|%d|0||||%s|%s", bstr("recp"), is_anonymous, bstr("cc"), bstr("bcc")); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -2561,7 +2572,15 @@ void display_enter(void) wprintf("\n", now); wprintf("\""); - wprintf("%s
\n", buf); /* header bar */ + wprintf("%s\n", buf); /* header bar */ + if (WC->room_flags & QR_ANONOPT) { + wprintf(" " + "", + (is_anonymous ? "checked" : "") + ); + wprintf("Anonymous"); + } + wprintf("
\n"); /* header bar */ wprintf("\n"); if (recipient_required) { -- 2.39.2