Disable RSS-shorter link expander.
[citadel.git] / citadel / modules / rssclient / serv_rssclient.c
index dd662ed085c2a7bb9fc02de17bed59f8249755a0..b991b4df13b2c372e794d36fcd98378d3af3ffb5 100644 (file)
@@ -386,6 +386,7 @@ int LookupUrl(StrBuf *ShorterUrlStr)
                rc = 1;
 
 shutdown:
+       FreeStrBuf(&Answer);
        curl_easy_cleanup(curl);
 
                return rc;
@@ -673,8 +674,13 @@ void rss_save_item(rss_item *ri)
                        msg->cm_fields['U'] = SmashStrBuf(&QPEncoded);
                        FreeStrBuf(&Encoded);
                }
+
+               if (ri->pubdate <= 0) {
+                       ri->pubdate = time(NULL);
+               }
                msg->cm_fields['T'] = malloc(64);
                snprintf(msg->cm_fields['T'], 64, "%ld", ri->pubdate);
+
                if (ri->channel_title != NULL) {
                        if (StrLength(ri->channel_title) > 0) {
                                msg->cm_fields['O'] = strdup(ChrPtr(ri->channel_title));
@@ -682,7 +688,10 @@ void rss_save_item(rss_item *ri)
                }
                if (ri->link == NULL) 
                        ri->link = NewStrBufPlain(HKEY(""));
+#ifdef EXPERIMENTAL_SHORTER_URLS
+/* its rather hard to implement this libevent compatible, so we don't ship it. */
                ExpandShortUrls(ri->description);
+#endif
                msglen += 1024 + StrLength(ri->link) + StrLength(ri->description) ;
 
                Message = NewStrBufPlain(NULL, StrLength(ri->description));