Backed out changeset 27d800ddc3b0 (see below)
authorMatthew Wild <mwild1@gmail.com>
Sat, 18 Aug 2018 14:30:14 +0100
changeset 9206 c65bfddd3cc5
parent 9205 27d800ddc3b0
child 9207 c5a81acc1fc3
Backed out changeset 27d800ddc3b0 (see below) It's uncertain whether item not existing should be success and nil, or fail with an error. XEP-0060's "fetch most recent item" actually fetches a list of up to N items. N here is a maximum, not a minimum. The feeling is that no items is simply an empty list, not a failure of the operation.
util/pubsub.lua
--- a/util/pubsub.lua	Sat Aug 18 14:21:02 2018 +0100
+++ b/util/pubsub.lua	Sat Aug 18 14:30:14 2018 +0100
@@ -598,8 +598,8 @@
 	end
 	--
 
-	-- Check node exists and has an item published
-	if not (self.nodes[node] and self.data[node]) then
+	-- Check node exists
+	if not self.nodes[node] then
 		return false, "item-not-found";
 	end