[Commits] [SCM] claws branch, master, updated. 3.16.0-237-g04070b4

ticho at claws-mail.org ticho at claws-mail.org
Sun Jul 15 10:26:28 CEST 2018


The branch, master has been updated
       via  04070b4fc26cd48806bfcb1f0666f95923657a4f (commit)
      from  d670b55a109ab0285453389d33e7c8ba8f649b58 (commit)

Summary of changes:
 src/plugins/rssyl/rssyl.c            |    2 ++
 src/plugins/rssyl/rssyl_cb_menu.c    |   10 ++++++++++
 src/plugins/rssyl/rssyl_feed.c       |   13 ++++++++++---
 src/plugins/rssyl/rssyl_feed_props.c |   11 +++++++++++
 src/plugins/rssyl/rssyl_subscribe.c  |    1 -
 5 files changed, 33 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 04070b4fc26cd48806bfcb1f0666f95923657a4f
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Jul 15 10:25:42 2018 +0200

    RSSyl: add more missing checks for offline mode
    
    Closes bug #4014 - "Work offline" doesn't seem to affect RSS

diff --git a/src/plugins/rssyl/rssyl.c b/src/plugins/rssyl/rssyl.c
index ea70028..c400e96 100644
--- a/src/plugins/rssyl/rssyl.c
+++ b/src/plugins/rssyl/rssyl.c
@@ -38,6 +38,7 @@
 #include <mh.h>
 #include <xml.h>
 #include <toolbar.h>
+#include <prefs_common.h>
 #include <prefs_toolbar.h>
 #include <utils.h>
 
@@ -156,6 +157,7 @@ void rssyl_init(void)
 	prefs_toolbar_register_plugin_item(TOOLBAR_MAIN, PLUGIN_NAME, _("Refresh all feeds"), rssyl_toolbar_cb_refresh_all_feeds, NULL);
 
 	if( rssyl_prefs_get()->refresh_on_startup &&
+			!prefs_common_get_prefs()->work_offline &&
 			claws_is_starting() )
 		g_timeout_add(2000, rssyl_update_all_feeds_deferred, NULL);
 }
diff --git a/src/plugins/rssyl/rssyl_cb_menu.c b/src/plugins/rssyl/rssyl_cb_menu.c
index 304d133..5874326 100644
--- a/src/plugins/rssyl/rssyl_cb_menu.c
+++ b/src/plugins/rssyl/rssyl_cb_menu.c
@@ -292,6 +292,16 @@ void rssyl_update_all_cb( GtkAction *action, gpointer data)
 		return;
 	}
 
+	/* Offline check */
+	if( prefs_common_get_prefs()->work_offline &&
+			!inc_offline_should_override(TRUE,
+					ngettext("Claws Mail needs network access in order "
+					"to update the feed.",
+					"Claws Mail needs network access in order "
+					"to update feeds.", 1))) {
+		return;
+	}
+
 	rssyl_update_recursively(item);
 }
 
diff --git a/src/plugins/rssyl/rssyl_feed.c b/src/plugins/rssyl/rssyl_feed.c
index dde0a20..cbc1459 100644
--- a/src/plugins/rssyl/rssyl_feed.c
+++ b/src/plugins/rssyl/rssyl_feed.c
@@ -82,10 +82,17 @@ gboolean rssyl_refresh_timeout_cb(gpointer data)
 	}
 
 	tmpdate = createRFC822Date(&tt);
-	debug_print(" %s: refresh %s (%d)\n", tmpdate, ctx->ritem->url,
-			ctx->ritem->refresh_id);
+
+	if (prefs_common_get_prefs()->work_offline) {
+		debug_print("RSSyl: %s: skipping update of %s (%d), we are offline\n",
+				tmpdate, ctx->ritem->url, ctx->ritem->refresh_id);
+	} else {
+		debug_print("RSSyl: %s: updating %s (%d)\n",
+				tmpdate, ctx->ritem->url, ctx->ritem->refresh_id);
+		rssyl_update_feed(ctx->ritem, 0);
+	}
+
 	g_free(tmpdate);
-	rssyl_update_feed(ctx->ritem, 0);
 
 	return TRUE;
 }
diff --git a/src/plugins/rssyl/rssyl_feed_props.c b/src/plugins/rssyl/rssyl_feed_props.c
index a43defe..112640e 100644
--- a/src/plugins/rssyl/rssyl_feed_props.c
+++ b/src/plugins/rssyl/rssyl_feed_props.c
@@ -30,7 +30,9 @@
 #include <gdk/gdkkeysyms.h>
 
 /* Claws Mail includes */
+#include <inc.h>
 #include <mainwindow.h>
+#include <prefs_common.h>
 #include <prefs_gtk.h>
 
 /* Local includes */
@@ -194,6 +196,15 @@ rssyl_props_trim_cb(GtkWidget *widget, gpointer data)
 	RFolderItem *ritem = (RFolderItem *)data;
 	gboolean k = ritem->keep_old;
 
+	if( prefs_common_get_prefs()->work_offline &&
+			!inc_offline_should_override(TRUE,
+					ngettext("Claws Mail needs network access in order "
+					"to update the feed.",
+					"Claws Mail needs network access in order "
+					"to update feeds.", 1))) {
+		return FALSE;
+	}
+
 	if( k )
 		ritem->keep_old = FALSE;
 
diff --git a/src/plugins/rssyl/rssyl_subscribe.c b/src/plugins/rssyl/rssyl_subscribe.c
index 1014385..25b5b17 100644
--- a/src/plugins/rssyl/rssyl_subscribe.c
+++ b/src/plugins/rssyl/rssyl_subscribe.c
@@ -41,7 +41,6 @@
 #include "rssyl_add_item.h"
 #include "rssyl_feed.h"
 #include "rssyl_gtk.h"
-#include "rssyl_update_feed.h"
 #include "rssyl_subscribe_gtk.h"
 #include "strutils.h"
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list