From 6e48cd5ece06914f4d55c17fbf936eb49acf8562 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 18 Aug 2018 14:30:14 +0100 Subject: 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/pubsub.lua b/util/pubsub.lua index ca6dca20..72f7f5a7 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -598,8 +598,8 @@ function service:get_last_item(node, actor) 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 -- cgit v1.2.3