]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* Removed the "convert_to_html" option from text_to_server() because we no
[citadel.git] / webcit / messages.c
index 9af483f6a7df928bf57cde866846d625ba1c59fb..37aeb321f6add845a808b88b8b04724824d5d6a4 100644 (file)
@@ -3,6 +3,7 @@
  */
 /**
  * \defgroup MsgDisp Functions which deal with the fetching and displaying of messages.
+ * \ingroup WebcitDisplayItems
  *
  */
 /*@{*/
@@ -11,9 +12,9 @@
 #include "webserver.h"
 #include "groupdav.h"
 
-#define SUBJ_COL_WIDTH_PCT                 50 /**< ??? */
-#define SENDER_COL_WIDTH_PCT           30 /**< ??? */
-#define DATE_PLUS_BUTTONS_WIDTH_PCT    20 /**< ??? */
+#define SUBJ_COL_WIDTH_PCT             50      /**< Mailbox view column width */
+#define SENDER_COL_WIDTH_PCT           30      /**< Mailbox view column width */
+#define DATE_PLUS_BUTTONS_WIDTH_PCT    20      /**< Mailbox view column width */
 
 /**
  * Address book entry (keep it short and sweet, it's just a quickie lookup
@@ -21,7 +22,7 @@
  */
 struct addrbookent {
        char ab_name[64]; /**< name string */
-       long ab_msgnum;   /**< number in the citadel???? */
+       long ab_msgnum;   /**< message number of address book entry */
 };
 
 
@@ -1025,7 +1026,8 @@ ENDBODY:
 /**
  * \brief Unadorned HTML output of an individual message, suitable
  * for placing in a hidden iframe, for printing, or whatever
- * \param msgnum_as_string the message to embed???
+ *
+ * \param msgnum_as_string Message number, as a string instead of as a long int
  */
 void embed_message(char *msgnum_as_string) {
        long msgnum = 0L;
@@ -1039,7 +1041,8 @@ void embed_message(char *msgnum_as_string) {
 
 /**
  * \brief Printable view of a message
- * \param msgnum_as_string the message to print??? 
+ *
+ * \param msgnum_as_string Message number, as a string instead of as a long int
  */
 void print_message(char *msgnum_as_string) {
        long msgnum = 0L;
@@ -1068,7 +1071,8 @@ void print_message(char *msgnum_as_string) {
 
 /**
  * \brief Display a message's headers
- * \param msgnum_as_string the message headers to print???
+ *
+ * \param msgnum_as_string Message number, as a string instead of as a long int
  */
 void display_headers(char *msgnum_as_string) {
        long msgnum = 0L;
@@ -1098,13 +1102,14 @@ void display_headers(char *msgnum_as_string) {
 
 /**
  * \brief Read message in simple, JavaScript-embeddable form for 'forward'
- * or 'reply quoted' operations.
+ *        or 'reply quoted' operations.
  *
  * NOTE: it is VITALLY IMPORTANT that we output no single-quotes or linebreaks
  *       in this function.  Doing so would throw a JavaScript error in the
  *       'supplied text' argument to the editor.
- * \param msgnum the citadel message number
- * \param forward_attachments atachment to forward???
+ *
+ * \param msgnum Message number of the message we want to quote
+ * \param forward_attachments Nonzero if we want attachments to be forwarded
  */
 void pullquote_message(long msgnum, int forward_attachments, int include_headers) {
        char buf[SIZ];
@@ -1405,8 +1410,9 @@ ENDBODY:
 }
 
 /**
- * \brief display sumarized item???
- * \param num hom many? which???
+ * \brief Display one row in the mailbox summary view
+ *
+ * \param num The row number to be displayed
  */
 void display_summarized(int num) {
        char datebuf[64];
@@ -1805,9 +1811,10 @@ int load_msg_ptrs(char *servcmd, int with_headers)
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two longs in descending order.
+ *
+ * \param s1 first number to compare 
+ * \param s2 second number to compare
  */
 int longcmp_r(const void *s1, const void *s2) {
        long l1;
@@ -1823,9 +1830,10 @@ int longcmp_r(const void *s1, const void *s2) {
 
  
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by ascending subject.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_subj(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1837,9 +1845,10 @@ int summcmp_subj(const void *s1, const void *s2) {
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by descending subject.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_rsubj(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1851,9 +1860,10 @@ int summcmp_rsubj(const void *s1, const void *s2) {
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by ascending sender.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_sender(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1865,9 +1875,10 @@ int summcmp_sender(const void *s1, const void *s2) {
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by descending sender.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_rsender(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1879,9 +1890,10 @@ int summcmp_rsender(const void *s1, const void *s2) {
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by ascending date.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_date(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1896,9 +1908,10 @@ int summcmp_date(const void *s1, const void *s2) {
 }
 
 /**
- * \brief compare what????
- * \param s1 first thing to compare 
- * \param s2 second thing to compare
+ * \brief qsort() compatible function to compare two message summary structs by descending date.
+ *
+ * \param s1 first item to compare 
+ * \param s2 second item to compare
  */
 int summcmp_rdate(const void *s1, const void *s2) {
        struct message_summary *summ1;
@@ -1912,9 +1925,12 @@ int summcmp_rdate(const void *s1, const void *s2) {
        else return 0;
 }
 
+
+
 /**
  * \brief command loop for reading messages
- * \param oper what???
+ *
+ * \param oper Set to "readnew" or "readold" or "readfwd" or "headers"
  */
 void readloop(char *oper)
 {
@@ -2187,6 +2203,11 @@ void readloop(char *oper)
                );
        }
 
+       if (is_notes) {
+               wprintf("<div align=center>%s</div>\n", _("Click on any note to edit it."));
+               wprintf("<div id=\"new_notes_here\"></div>\n");
+       }
+
        for (a = 0; a < nummsgs; ++a) {
                if ((WC->msgarr[a] >= startmsg) && (num_displayed < maxmsgs)) {
 
@@ -2424,7 +2445,7 @@ void post_mime_to_server(void) {
        serv_puts("Content-type: text/html; charset=utf-8");
        serv_puts("");
        serv_puts("<html><body>\n");            /** Future templates go here */
-       text_to_server(bstr("msgtext"), 0);
+       text_to_server(bstr("msgtext"));
        serv_puts("</body></html>\n");
        
 
@@ -2699,8 +2720,11 @@ void display_enter(void)
        stresc(&buf[strlen(buf)], WC->wc_roomname, 1, 1);
 
        /** begin message entry screen */
-       wprintf("<form enctype=\"multipart/form-data\" "
-               "method=\"POST\" action=\"post\" "
+       wprintf("<form "
+               "enctype=\"multipart/form-data\" "
+               "method=\"POST\" "
+               "accept-charset=\"UTF-8\" "
+               "action=\"post\" "
                "name=\"enterform\""
                ">\n");
        wprintf("<input type=\"hidden\" name=\"postseq\" value=\"%ld\">\n", now);