* add author to atoms
authorWilfried Göesgens <willi@citadel.org>
Thu, 19 Nov 2009 21:28:35 +0000 (21:28 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 19 Nov 2009 21:28:35 +0000 (21:28 +0000)
* fix author for rss

citadel/modules/rssclient/serv_rssclient.c

index 0bdff60891e72418d7d44906fdb43b1612da8b8e..9f0298d44b57480d6f37db229d98cf6d98a1f074 100644 (file)
@@ -85,6 +85,7 @@ typedef struct _rss_item {
        char channel_title[256];
        int item_tag_nesting;
        char *author_or_creator;
+       char *author_url;
 }rss_item;
 
 
@@ -575,7 +576,7 @@ void rss_xml_end(void *data, const char *supplied_el) {
                ri->pubdate = rdf_parsedate(ri->chardata);
        }
 
-       else if ((rssc->Cfg->ItemType == RSS_ATOM) && 
+       else if ((rssc->Cfg->ItemType == RSS_RSS) && 
                 ((!strcasecmp(el, "author")) || 
                  (!strcasecmp(el, "creator"))) && 
                 (ri->chardata != NULL) ) {
@@ -584,6 +585,21 @@ void rss_xml_end(void *data, const char *supplied_el) {
                ri->author_or_creator = strdup(ri->chardata);
        }
 
+       else if ((rssc->Cfg->ItemType == RSS_ATOM) && 
+                (!strcasecmp(el, "name")) && 
+                (ri->chardata != NULL) ) {
+               if (ri->author_or_creator != NULL) free(ri->author_or_creator);
+               striplt(ri->chardata);
+               ri->author_or_creator = strdup(ri->chardata);
+       }
+       else if ((rssc->Cfg->ItemType == RSS_ATOM) && 
+                (!strcasecmp(el, "uri")) && 
+                (ri->chardata != NULL) ) {
+               if (ri->author_url != NULL) free(ri->author_url);
+               striplt(ri->chardata);
+               ri->author_url = strdup(ri->chardata);
+       }
+
        else if ((rssc->Cfg->ItemType == RSS_RSS) && 
                 !strcasecmp(el, "item")) {
                --ri->item_tag_nesting;