mod_pubsub_feeds: Fix refreshing of subscriptions
authorKim Alvefur <zash@zash.se>
Thu, 26 Jun 2014 18:32:43 +0200
changeset 1455 13e359c48b5b
parent 1454 480c6f0576b1
child 1456 2cd667d8edbd
mod_pubsub_feeds: Fix refreshing of subscriptions
mod_pubsub_feeds/mod_pubsub_feeds.lua
--- 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);