Extracting the 'To:' header from the replying_to message now works.
authorArt Cancro <ajc@uncensored.citadel.org>
Wed, 13 Jul 2011 21:27:28 +0000 (17:27 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:34:50 +0000 (21:34 +0000)
webcit/README.txt
webcit/messages.c
webcit/static/t/view_message.html

index 2bc50943d32c7c30cb4e95802c8847551827bf5b..7d6bd8593cd479218942197cd5e5e6cdbb725cab 100644 (file)
@@ -254,7 +254,7 @@ virtual host through to WebCit.  The alternative way, which does work but is not
 quite as robust, is to "mount" the WebCit paths as directory aliases to your
 main document root.
 
-Here is how to configure the NameVirtualHost method:
+Here is how to configure the NameVirtualHost method (recommended) :
 
 <VirtualHost mydomain.com:443>
        #here some of your config stuff like logging, serveradmin...
@@ -269,7 +269,7 @@ Here is how to configure the NameVirtualHost method:
     alias /static /var/lib/citadel/www/static
 </VirtualHost>
 
-Here is how to configure the "subdirectory" method:
+Here is how to configure the "subdirectory" method (not recommended) :
 
 <VirtualHost mydomain.com:443>
        #here some of your config stuff like logging, serveradmin...
@@ -295,9 +295,6 @@ Here is how to configure the "subdirectory" method:
     ProxyPassReverse /groupdav/ http://127.0.0.1:2000/groupdav/
     ProxyPass /who_inner_html http://127.0.0.1:2000/who_inner_html
     ProxyPassReverse /who_inner_html http://127.0.0.1:2000/who_inner_html
-# The following line is optional.  It allows WebCit's static content
-# such as images to be served directly by Apache.
-    alias /static /var/lib/citadel/www/static
 </VirtualHost>
 
   
@@ -328,5 +325,5 @@ bin: the binaries.
  ----------
  
  That's all you need to know to get started.  If you have any questions or
-comments, please visit UNCENSORED! BBS, the home of Citadel, at
-http://uncensored.citadel.org - and go to the "Citadel Support" room.
+comments, visit the Citadel Support room on UNCENSORED! BBS, the home of Citadel:
+http://uncensored.citadel.org/dotgoto?room=Citadel%20Support
index 049b1f10f7cb29adc23d2e46d9c2b8e3bfeb4681..6e9b087290c537b4f34a50a3eff26e61ac674372 100644 (file)
@@ -1289,6 +1289,7 @@ void display_enter(void)
        int recipient_bad = 0;
        int is_anonymous = 0;
        wcsession *WCC = WC;
+       int i = 0;
 
        now = time(NULL);
 
@@ -1355,15 +1356,25 @@ void display_enter(void)
        long replying_to = lbstr("replying_to");
        if (replying_to > 0) {
                char wefw[1024] = "";
-               char msgn[1024] = "";
+               char msgn[256] = "";
+               char from[256] = "";
+               char node[256] = "";
+               char rfca[256] = "";
                serv_printf("MSG0 %ld|1", replying_to); 
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
 
                        if ( (!strncasecmp(buf, "subj=", 5)) && (strlen(buf) > 5) ) {
                                StrBuf *subj = NewStrBuf();
-                               if (strncasecmp(&buf[5], "Re:", 3)) {
-                                       StrBufAppendBufPlain(subj, HKEY("Re: "), 0);
+                               if (!strcasecmp(bstr("replying_mode"), "forward")) {
+                                       if (strncasecmp(&buf[5], "Fw:", 3)) {
+                                               StrBufAppendBufPlain(subj, HKEY("Fw: "), 0);
+                                       }
+                               }
+                               else {
+                                       if (strncasecmp(&buf[5], "Re:", 3)) {
+                                               StrBufAppendBufPlain(subj, HKEY("Re: "), 0);
+                                       }
                                }
                                StrBufAppendBufPlain(subj, &buf[5], -1, 0);
                                PutBstr(HKEY("subject"), subj);
@@ -1386,6 +1397,21 @@ void display_enter(void)
                                safestrncpy(msgn, &buf[5], sizeof msgn);
                        }
 
+                       else if (!strncasecmp(buf, "from=", 5)) {
+                               safestrncpy(from, &buf[5], sizeof from);
+                               for (i=0; i<strlen(from); ++i) {
+                                       if (from[i] == ',') from[i] = ' ';
+                               }
+                       }
+
+                       else if (!strncasecmp(buf, "node=", 5)) {
+                               safestrncpy(node, &buf[5], sizeof node);
+                       }
+
+                       else if (!strncasecmp(buf, "rfca=", 5)) {
+                               safestrncpy(rfca, &buf[5], sizeof rfca);
+                       }
+
                }
 
                if (strlen(wefw) + strlen(msgn) > 0) {
@@ -1401,6 +1427,22 @@ void display_enter(void)
                        }
                        PutBstr(HKEY("references"), refs);
                }
+
+               if (!strcasecmp(bstr("replying_mode"), "reply")) {
+                       StrBuf *to_rcpt = NewStrBuf();
+                       if (!IsEmptyStr(rfca)) {
+                               StrBufAppendPrintf(to_rcpt, "%s <%s>", from, rfca);
+                       }
+                       else {
+                               StrBufAppendPrintf(to_rcpt, "%s", from);
+                               if (    (!IsEmptyStr(node))
+                                       && (strcasecmp(node, ChrPtr(WC->serv_info->serv_nodename)))
+                               ) {
+                                       StrBufAppendPrintf(to_rcpt, " @ %s", node);
+                               }
+                       }
+                       PutBstr(HKEY("recp"), to_rcpt);
+               }
        }
 
        /*
index 82c32275cc7f4073224824c2217f74d69c50dec6..cbe7fc9678bf99ed87b420618fc71d98c00d3ca2 100644 (file)
  <p id="msg<?MAIL:SUMM:N>" class="msgbuttons">
  <a href="display_enter?edit=<?MAIL:SUMM:N>?recp=<?MAIL:SUMM:TO("U")>?cc=<?MAIL:SUMM:CCCC("U")>?subject=<?MAIL:SUMM:SUBJECT("U", 0, "", "")>?force_room=_MAIL_"><span>[</span><?_("Edit")><span>]</span></a> 
 <?!("COND:ROOM:TYPE_IS", 8, #"VIEW_BBS")>
-   <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_to=<?MAIL:SUMM:N>'));"><span>[</span><?_("Reply")><span>]</span></a> 
-   <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_to=<?MAIL:SUMM:N>?replyquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("ReplyQuoted")><span>]</span></a> 
+       <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_to=<?MAIL:SUMM:N>'));"><span>[</span><?_("Reply")><span>]</span></a> 
+       <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_to=<?MAIL:SUMM:N>?replyquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("ReplyQuoted")><span>]</span></a> 
 <?!("X", 8)>
 <??("COND:ROOM:TYPE_IS", 9, #"VIEW_BBS")>
-       <?!("COND:MAIL:SUMM:RFCA", 10)>
-               <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E?subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re: ", "Re:")>'));"><span>[</span><?_("Reply")><span>]</span></a> 
-               <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=%22<?MAIL:SUMM:FROM("U")>%22%3C<?MAIL:SUMM:RFCA("U")>%3E%2C<?MAIL:SUMM:ALLRCPT("U")>?subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re: ", "Re:")>'));"><span>[</span><?_("ReplyAll")><span>]</span></a> 
-               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fw: ", "Fw:")>"><span>[</span><?_("Forward")><span>]</span></a> 
-       <?!("X", 10)>
-       <??("COND:MAIL:SUMM:RFCA", 11)>
-               <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=<?MAIL:SUMM:FROM("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re: ", "Re:")>'));"><span>[</span><?_("Reply")><span>]</span></a> 
-               <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?replyquote=<?MAIL:SUMM:N>?recp=<?MAIL:SUMM:FROM("U")>%2C<?MAIL:SUMM:ALLRCPT("U")>&references=<?MAIL:SUMM:INREPLYTO("U")>%3C<?MAIL:SUMM:RFCA("U")>%3E&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Re: ", "Re:")>'));"><span>[</span><?_("ReplyAll")><span>]</span></a> 
-               <a href="display_enter?references=<?MAIL:SUMM:REFIDS("U")>%7C<?MAIL:SUMM:INREPLYTO("U")>?fwdquote=<?MAIL:SUMM:N>&subject=<?MAIL:SUMM:SUBJECT("U", 0, "Fw: ", "Fw:")>"><span>[</span><?_("Forward")><span>]</span></a> 
-       <??("X", 11)>
+       <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=reply?replying_to=<?MAIL:SUMM:N>?replyquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("Reply")><span>]</span></a> 
+       <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=replyall?replying_to=<?MAIL:SUMM:N>?replyquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("ReplyAll")><span>]</span></a> 
+       <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=forward?replying_to=<?MAIL:SUMM:N>?fwdquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("Forward")><span>]</span></a> 
 <??("X", 9)>
 <?!("COND:ROOM:EDITACCESS", 14)>
    <a href="confirm_move_msg?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a>