Changeset

1455:13e359c48b5b

mod_pubsub_feeds: Fix refreshing of subscriptions
author Kim Alvefur <zash@zash.se>
date Thu, 26 Jun 2014 18:32:43 +0200
parents 1454:480c6f0576b1
children 1456:2cd667d8edbd
files mod_pubsub_feeds/mod_pubsub_feeds.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_feeds/mod_pubsub_feeds.lua	Thu Jun 26 18:29:01 2014 +0200
+++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua	Thu Jun 26 18:32:43 2014 +0200
@@ -113,9 +113,13 @@
 		end
 	end
 
+	if item.lease_expires > time() then
+		item.subscription = nil;
+		item.lease_expires = nil;
+	end
 	if use_pubsubhubub and not item.subscription then
 		--module:log("debug", "check if %s has a hub", item.node);
-		local hub = feed.links and feed.links.hub;
+		local hub = item.hub or feed.links and feed.links.hub;
 		if hub then
 			item.hub = hub;
 			module:log("debug", "%s has a hub: %s", item.node, item.hub);