* Eliminated a bug in pullquote_message() that was causing it to run words
authorArt Cancro <ajc@citadel.org>
Wed, 25 Jan 2006 04:10:51 +0000 (04:10 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 25 Jan 2006 04:10:51 +0000 (04:10 +0000)
  together at the linebreaks.
* After creating or editing a Wiki page, display that page instead of
  that wiki's home page.

webcit/ChangeLog
webcit/messages.c
webcit/roomops.c
webcit/webcit.c
webcit/wiki.c

index cfe173af9369bc37f3bd297c09aceb5b3c96f25d..7b2a14f6b117da8bf8cfa0a22c21d6a93fd54d55 100644 (file)
@@ -1,5 +1,11 @@
 $Id$
 
+Tue Jan 24 23:02:37 EST 2006 ajc
+* Eliminated a bug in pullquote_message() that was causing it to run words
+  together at the linebreaks.
+* After creating or editing a Wiki page, display that page instead of
+  that wiki's home page.
+
 Tue Jan 24 13:56:03 EST 2006 ajc
 * Fixes to wiki view to handle "short" links.
 
index 84689122c86bc7ff9a4d55d3f5c818b5be32e089..11220d2e07fa09ca2d805d3dd2c728e19d260e1c 100644 (file)
@@ -1330,6 +1330,7 @@ void pullquote_message(long msgnum, int forward_attachments) {
        /** HTML just gets escaped and stuffed back into the editor */
        else if (!strcasecmp(mime_content_type, "text/html")) {
                while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                       strcat(buf, "\n");
                        msgescputs(buf);
                }
        }
@@ -2557,7 +2558,27 @@ void post_message(void)
        }
 
        free_attachments(WC);
-       readloop("readnew");
+
+       /**
+        *  We may have been supplied with instructions regarding the location
+        *  to which we must return after posting.  If found, go there.
+        */
+       if (strlen(bstr("return_to")) > 0) {
+               http_redirect(bstr("return_to"));
+       }
+       /**
+        *  If we were editing a page in a wiki room, go to that page now.
+        */
+       else if (strlen(bstr("wikipage")) > 0) {
+               snprintf(buf, sizeof buf, "wiki?page=%s", bstr("wikipage"));
+               http_redirect(buf);
+       }
+       /**
+        *  Otherwise, just go to the "read messages" loop.
+        */
+       else {
+               readloop("readnew");
+       }
 }
 
 
@@ -2682,6 +2703,7 @@ void display_enter(void)
        if (WC->wc_view == VIEW_WIKI) {
                wprintf("<input type=\"hidden\" name=\"wikipage\" value=\"%s\">\n", bstr("wikipage"));
        }
+       wprintf("<input type=\"hidden\" name=\"return_to\" value=\"%s\">\n", bstr("return_to"));
 
        wprintf("<img src=\"static/newmess3_24x.gif\" align=middle alt=\" \">");
        wprintf("%s\n", buf);   /** header bar */
index 68476bfb5f20f99af0d813bb8fba1b4cf9bab5c9..f0df5cce2f4d90d3f861e9d08da3758856801dbe 100644 (file)
@@ -485,6 +485,17 @@ void embed_room_banner(char *got, int navbar_style) {
                                                "</span></a></td>\n", _("View message list")
                                        );
                                        break;
+                               case VIEW_WIKI:
+                                       wprintf(
+                                               "<td>"
+                                               "<a href=\"readfwd\">"
+                                               "<img align=\"middle\" src=\"static/readallmess3_24x.gif\" "
+                                               "border=\"0\">"
+                                               "<span class=\"navbar_link\">"
+                                               "%s"
+                                               "</span></a></td>\n", _("Wiki home")
+                                       );
+                                       break;
                                default:
                                        wprintf(
                                                "<td>"
index 641b356157f0acc2e4d1e45d185f9fbdce317724..e1852a901f00c322bbe4ba332f4036d19ab85257 100644 (file)
@@ -363,8 +363,8 @@ void msgesc(char *target, char *strbuf)
 }
 
 /**
- * \brief print message to the client ???
- * \param strbuf message to print???
+ * \brief print a string to the client after cleaning it with msgesc()
+ * \param strbuf string to be printed
  */
 void msgescputs(char *strbuf) {
        char *outbuf;
@@ -648,7 +648,7 @@ void output_image()
  * \brief Generic function to output an arbitrary MIME part from an arbitrary
  * message number on the server.
  * \param msgnum number of the item on the citadel server
- * \param partnum the partnumber???
+ * \param partnum the MIME part to be output
  */
 void mimepart(char *msgnum, char *partnum)
 {
@@ -683,7 +683,7 @@ void mimepart(char *msgnum, char *partnum)
 /**
  * \brief Read any MIME part of a message, from the server, into memory.
  * \param msgnum number of the message on the citadel server
- * \param partnum the part number???
+ * \param partnum the MIME part to be loaded
  */
 char *load_mimepart(long msgnum, char *partnum)
 {
@@ -795,7 +795,7 @@ void change_start_page(void) {
 
 
 /**
- * \brief display the successfull edit or s.th. lisket hat ??? 
+ * \brief convenience function to indicate success
  * \param successmessage the mesage itself
  */
 void display_success(char *successmessage)
index 852650cb643a0b2dbca81ffce929aa8c9d7fe14f..6c74212d5a8fded65120271c55f7d99f1d94c53d 100644 (file)
@@ -9,6 +9,7 @@
 
 /*@{*/
 #include "webcit.h"
+#include "groupdav.h"
 
 
 
@@ -98,9 +99,8 @@ void display_wiki_page(void)
        wprintf("<br><b>");
        wprintf(_("There is no page called '%s' here."), pagename);
        wprintf("</b><br><br>");
-       wprintf("<a href=\"display_enter?wikipage=%s\">", pagename);
-       wprintf(_("Click here if you would like to create this page."));
-       wprintf("</a>");
+       wprintf(_("Select the 'Edit this page' link in the room banner "
+               "if you would like to create this page."));
        wprintf("<br><br>");
        wprintf("</td></tr></table></div>\n");
        wDumpContent(1);