Add a forgotten RSSyl: prefix to log_print message from previous commit.
[claws.git] / src / plugins / rssyl / rssyl_update_feed.c
index 51d6c97f60a334a9f79681ebe8fdf97c31cfb56c..eef5753fdbea06188020d282124f8ad910706de0 100644 (file)
@@ -134,9 +134,7 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
 
                ctx->success = FALSE;
        } else {
-               if( feed_get_title(ctx->feed) == NULL ) {
-                       /* libcurl was happy, but libfeed wasn't */
-                       debug_print("RSSyl: Error reading feed\n");
+               if( ctx->feed == NULL ) {
                        if( verbose ) {
                                gchar *msg = g_markup_printf_escaped(
                                                (const char *) _("No valid feed found at\n<b>%s</b>"),
@@ -149,6 +147,12 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
                                        feed_get_url(ctx->feed));
 
                        ctx->success = FALSE;
+               } else if (feed_get_title(ctx->feed) == NULL) {
+                       /* We shouldn't do this, since a title is mandatory. */
+                       feed_set_title(ctx->feed, _("Untitled feed"));
+                       log_print(LOG_PROTOCOL,
+                                       _("RSSyl: Possibly invalid feed without title at %s.\n"),
+                                       feed_get_url(ctx->feed));
                }
        }
 }
@@ -165,10 +169,16 @@ RFetchCtx *rssyl_prep_fetchctx_from_item(RFolderItem *ritem)
        ctx->success = TRUE;
        ctx->ready = FALSE;
 
-       feed_set_timeout(ctx->feed, prefs_common.io_timeout_secs);
+       feed_set_timeout(ctx->feed, prefs_common_get_prefs()->io_timeout_secs);
        feed_set_cookies_path(ctx->feed, rssyl_prefs_get()->cookies_path);
        feed_set_ssl_verify_peer(ctx->feed, ritem->ssl_verify_peer);
        feed_set_auth(ctx->feed, ritem->auth);
+#ifdef G_OS_WIN32
+       if (!g_ascii_strncasecmp(ritem->url, "https", 5)) {
+               feed_set_cacert_file(ctx->feed, claws_ssl_get_cert_file());
+               debug_print("RSSyl: using cert file '%s'\n", feed_get_cacert_file(ctx->feed));
+       }
+#endif
 
        return ctx;
 }
@@ -185,9 +195,15 @@ RFetchCtx *rssyl_prep_fetchctx_from_url(gchar *url)
        ctx->success = TRUE;
        ctx->ready = FALSE;
 
-       feed_set_timeout(ctx->feed, prefs_common.io_timeout_secs);
+       feed_set_timeout(ctx->feed, prefs_common_get_prefs()->io_timeout_secs);
        feed_set_cookies_path(ctx->feed, rssyl_prefs_get()->cookies_path);
        feed_set_ssl_verify_peer(ctx->feed, rssyl_prefs_get()->ssl_verify_peer);
+#ifdef G_OS_WIN32
+       if (!g_ascii_strncasecmp(url, "https", 5)) {
+               feed_set_cacert_file(ctx->feed, claws_ssl_get_cert_file());
+               debug_print("RSSyl: using cert file '%s'\n", feed_get_cacert_file(ctx->feed));
+       }
+#endif
 
        return ctx;
 }
@@ -313,7 +329,7 @@ void rssyl_update_all_func(FolderItem *item, gpointer data)
 
 void rssyl_update_all_feeds(void)
 {
-       if (prefs_common.work_offline &&
+       if (prefs_common_get_prefs()->work_offline &&
                        !inc_offline_should_override(TRUE,
                                _("Claws Mail needs network access in order to update your feeds.")) ) {
                return;