Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 7 Sep 2010 21:01:12 +0000 (23:01 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 7 Sep 2010 21:01:12 +0000 (23:01 +0200)
citadel/modules/rssclient/serv_rssclient.c
citadel/msgbase.c
libcitadel/tests/email_recipientstrings.txt

index 404d879e7cefbbed44c444d796a55b9686b59e16..50ab007f25d1f449f54103245d6b233993a0b394 100644 (file)
@@ -84,6 +84,7 @@ typedef struct _rss_item {
        int item_tag_nesting;
        char *author_or_creator;
        char *author_url;
+       StrBuf *CData;
 }rss_item;
 
 
@@ -500,6 +501,7 @@ void flush_rss_ite(rss_item *ri)
                ri->chardata = 0;
                ri->chardata_len = 0;
        }
+       FreeStrBuf(&ri->CData);
 }
 
 void rss_xml_start(void *data, const char *supplied_el, const char **attr) {
@@ -690,6 +692,19 @@ void rss_xml_end(void *data, const char *supplied_el) {
 /*
  * This callback stores up the data which appears in between tags.
  */
+void rss_xml_cdata_start(void *data) {
+       rsscollection *rssc = (rsscollection*) data;
+       rss_item *ri = rssc->Item;
+
+       ri->CData = NewStrBuf();
+}
+
+void rss_xml_cdata_end(void *data) {
+       rsscollection *rssc = (rsscollection*) data;
+       rss_item *ri = rssc->Item;
+
+       ri->description = SmashStrBuf(&ri->CData);
+}
 void rss_xml_chardata(void *data, const XML_Char *s, int len) {
        rsscollection *rssc = (rsscollection*) data;
        rss_item *ri = rssc->Item;
@@ -697,19 +712,21 @@ void rss_xml_chardata(void *data, const XML_Char *s, int len) {
        int new_len;
        char *new_buffer;
 
-       old_len = ri->chardata_len;
-       new_len = old_len + len;
-       new_buffer = realloc(ri->chardata, new_len + 1);
-       if (new_buffer != NULL) {
-               memcpy(&new_buffer[old_len], s, len);
-               new_buffer[new_len] = 0;
-               ri->chardata = new_buffer;
-               ri->chardata_len = new_len;
+       if (ri->CData != NULL) {
+               StrBufAppendBufPlain (ri->CData, s, len, 0);
+       } else {
+               old_len = ri->chardata_len;
+               new_len = old_len + len;
+               new_buffer = realloc(ri->chardata, new_len + 1);
+               if (new_buffer != NULL) {
+                       memcpy(&new_buffer[old_len], s, len);
+                       new_buffer[new_len] = 0;
+                       ri->chardata = new_buffer;
+                       ri->chardata_len = new_len;
+               }
        }
 }
 
-
-
 /*
  * Callback function for passing libcurl's output to expat for parsing
  */
@@ -785,6 +802,9 @@ void rss_do_fetching(rssnetcfg *Cfg) {
        XML_SetElementHandler(xp, rss_xml_start, rss_xml_end);
        XML_SetCharacterDataHandler(xp, rss_xml_chardata);
        XML_SetUserData(xp, &rssc);
+       XML_SetCdataSectionHandler(xp,
+                                  rss_xml_cdata_start,
+                                  rss_xml_cdata_end);
        if (CtdlThreadCheckStop())
        {
                XML_ParserFree(xp);
index cd4fd5e41dd240b25a8f8bc2019f7b68e9b8d654..d7f832a7b9aaf91b116cd8c3b8aad1c292a9e862 100644 (file)
@@ -4033,12 +4033,13 @@ void cmd_ent0(char *entargs)
        /* In mailbox rooms we have to behave a little differently --
         * make sure the user has specified at least one recipient.  Then
         * validate the recipient(s).  We do this for the Mail> room, as
-        * well as any room which has the "Mailbox" view set.
+        * well as any room which has the "Mailbox" view set - unless it
+        * is the DRAFTS room which does not require recipients
         */
 
-       if (  ( (CC->room.QRflags & QR_MAILBOX) && (!strcasecmp(&CC->room.QRname[11], MAILROOM)) )
-          || ( (CC->room.QRflags & QR_MAILBOX) && (CC->curr_view == VIEW_MAILBOX) )
-       ) {
+       if (  ( (CC->room.QRflags & QR_MAILBOX) && (!strcasecmp(&CC->room.QRname[11], MAILROOM)) )
+            || ( (CC->room.QRflags & QR_MAILBOX) && (CC->curr_view == VIEW_MAILBOX) )
+       ) && (strcasecmp(&CC->room.QRname[11], USERDRAFTROOM)) !=0 ) {
                if (CC->user.axlevel < AxProbU) {
                        strcpy(recp, "sysop");
                        strcpy(cc, "");
index 14d66c2615f88badaa9bf2a0897c293cc859b92b..2d22ab098e2b72ee11e781c9d4526c27923e90ef 100644 (file)
@@ -4,3 +4,4 @@ dothebart@uncensored.citadel.org
 Art Cancro <ajc@uncensored.citadel.org>, Art Cancro <ajc@uncensored.citadel.org>
 Hüttemann Detlef
 "Hüttemann Detlef"<somebody@cosmocode.de>,Wilfried Goesgens <me.in@o3sis.com>, Lang Adrian <somebodyelse@cosmocode.de>, Gohr Andreas <da_splitbaiin@cosmocode.de>
+Holger Müller