Enter message / write mail dialog : present a drop-down box
authorArt Cancro <ajc@citadel.org>
Thu, 22 Feb 2007 22:24:14 +0000 (22:24 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 22 Feb 2007 22:24:14 +0000 (22:24 +0000)
allowing the user to enter a message using their account's screen name,
the friendly name on their vCard, or anonymous (if allowed in the current
room).

webcit/configure.ac
webcit/messages.c
webcit/webcit.h

index b07cd2660dc647ee3fac5dac4387ab2524e63660..a2e214ce6225e6dd429ef3b6d0b8952d8ac7aea0 100644 (file)
@@ -4,7 +4,7 @@ AC_INIT(webserver.c)
 
 
 PACKAGE=webcit
-VERSION=7.02
+VERSION=7.05
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
 AC_SUBST(PACKAGE)
index ad561f75a1a2d6c89cdfe1197b740868f212acd9..ed89b48996db86c67f916db45f7b91e95b161733 100644 (file)
@@ -2657,8 +2657,11 @@ void post_message(void)
        static long dont_post = (-1L);
        struct wc_attachment *att, *aptr;
        int is_anonymous = 0;
+       char *display_name;
 
-       if (!strcasecmp(bstr("is_anonymous"), "yes")) {
+       display_name = bstr("display_name");
+       if (!strcmp(display_name, "__ANONYMOUS__")) {
+               display_name = "";
                is_anonymous = 1;
        }
 
@@ -2717,10 +2720,11 @@ void post_message(void)
                        "saved this message."));
        } else {
                rfc2047encode(encoded_subject, sizeof encoded_subject, bstr("subject"));
-               sprintf(buf, "ENT0 1|%s|%d|4|%s|||%s|%s|%s",
+               sprintf(buf, "ENT0 1|%s|%d|4|%s|%s||%s|%s|%s",
                        bstr("recp"),
                        is_anonymous,
                        encoded_subject,
+                       display_name,
                        bstr("cc"),
                        bstr("bcc"),
                        bstr("wikipage")
@@ -2781,6 +2785,7 @@ void display_enter(void)
        char buf[SIZ];
        char ebuf[SIZ];
        long now;
+       char *display_name;
        struct wc_attachment *att;
        int recipient_required = 0;
        int recipient_bad = 0;
@@ -2794,7 +2799,9 @@ void display_enter(void)
                gotoroom(bstr("force_room"));
        }
 
-       if (!strcasecmp(bstr("is_anonymous"), "yes")) {
+       display_name = bstr("display_name");
+       if (!strcmp(display_name, "__ANONYMOUS__")) {
+               display_name = "";
                is_anonymous = 1;
        }
 
@@ -2853,7 +2860,10 @@ void display_enter(void)
 
        /** Now check our actual recipients if there are any */
        if (recipient_required) {
-               sprintf(buf, "ENT0 0|%s|%d|0||||%s|%s|%s", bstr("recp"), is_anonymous,
+               sprintf(buf, "ENT0 0|%s|%d|0||%s||%s|%s|%s",
+                       bstr("recp"),
+                       is_anonymous,
+                       display_name,
                        bstr("cc"), bstr("bcc"), bstr("wikipage"));
                serv_puts(buf);
                serv_getln(buf, sizeof buf);
@@ -2892,17 +2902,34 @@ void display_enter(void)
        wprintf("%s ", buf);
 
        wprintf(_(" <I>from</I> "));
-       escputs(WC->wc_fullname);
-       wprintf(_(" <I>in</I> "));
-       escputs(WC->wc_roomname);
+
+       wprintf("<select name=\"display_name\" size=1>\n");
+
+       serv_puts("GVSN");
+       serv_getln(buf, sizeof buf);
+       if (buf[0] == '1') {
+               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                       wprintf("<option %s value=\"",
+                               ((!strcasecmp(bstr("display_name"), buf)) ? "selected" : "")
+                       );
+                       escputs(buf);
+                       wprintf("\">");
+                       escputs(buf);
+                       wprintf("</option>\n");
+               }
+       }
 
        if (WC->room_flags & QR_ANONOPT) {
-               wprintf("&nbsp;"
-                       "<input type=\"checkbox\" name=\"is_anonymous\" value=\"yes\" %s>",
-                               (is_anonymous ? "checked" : "")
+               wprintf("<option %s value=\"__ANONYMOUS__\">%s</option>\n",
+                       ((!strcasecmp(bstr("__ANONYMOUS__"), WC->wc_fullname)) ? "selected" : ""),
+                       _("Anonymous")
                );
-               wprintf("Anonymous");
        }
+
+       wprintf("</select>\n");
+
+       wprintf(_(" <I>in</I> "));
+       escputs(WC->wc_roomname);
        wprintf("<br>\n");      /** header bar */
 
        wprintf("<table border=\"0\" width=\"100%%\">\n");
index 6dc14d2f17d9b8747ecf650d17a0c215acb5c6f2..3f8cf1602798bd2314fca7c36d50e75c64ca57d4 100644 (file)
@@ -122,11 +122,11 @@ extern locale_t wc_locales[];
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v7.02"  /* who's in da house */
+#define SERVER                 "WebCit v7.05"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         702             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    690             /* min required Citadel ver. */
+#define CLIENT_VERSION         705             /* This version of WebCit */
+#define MINIMUM_CIT_VERSION    705             /* min required Citadel ver. */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */