]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/rssclient/serv_rssclient.c
parse uidl list
[citadel.git] / citadel / modules / rssclient / serv_rssclient.c
index 686dd7268cedffe0b25578ee304ea3403262d08b..79b1fc3054ba20f1e4f61db19fb0b9aee8611fcb 100644 (file)
@@ -134,7 +134,7 @@ void rss_end_element(void *data, const char *el)
                        // check the use table
                        StrBuf *u = NewStrBuf();
                        StrBufAppendPrintf(u, "rss/%s", r->item_id);
-                       time_t already_seen = CheckIfAlreadySeen("rss", u, time(NULL), 604800, eUpdate, 0, 0);
+                       time_t already_seen = CheckIfAlreadySeen(u, time(NULL), 604800, eUpdate);
                        FreeStrBuf(&u);
 
                        if (already_seen == 0) {
@@ -254,6 +254,7 @@ void rss_end_element(void *data, const char *el)
        else if (
                (!strcasecmp(el, "description"))                // message text (rss)
                || (!strcasecmp(el, "summary"))                 // message text (atom)
+               || (!strcasecmp(el, "content"))                 // message text (atom)
        ) {
                if (r->description != NULL) {
                        free(r->description);
@@ -331,17 +332,6 @@ void rssclient_push_todo(char *rssurl, char *roomname)
 }
 
 
-// Callback function for curl
-//
-size_t rss_pof_write_data(void *buffer, size_t size, size_t nmemb, void *userp)
-{
-       StrBuf *Downloaded = (StrBuf *)userp;
-       size_t bytes = size * nmemb;
-       StrBufAppendBufPlain(Downloaded, buffer, bytes, 0);
-       return(bytes);
-}
-
-
 // pull one feed (possibly multiple rooms)
 //
 void rss_pull_one_feed(struct rssurl *url)
@@ -361,7 +351,7 @@ void rss_pull_one_feed(struct rssurl *url)
 
        curl_easy_setopt(curl, CURLOPT_URL, url->url);
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);                     // Follow redirects
-       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, rss_pof_write_data);      // What to do with downloaded data
+       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlFillStrBuf_callback); // What to do with downloaded data
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, Downloaded);                  // Give it our StrBuf to work with
        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L);                           // Time out after 20 seconds
        res = curl_easy_perform(curl);                                          // Perform the request