Comparison

util/pubsub.lua @ 9203:c65bfddd3cc5

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.
author Matthew Wild <mwild1@gmail.com>
date Sat, 18 Aug 2018 14:30:14 +0100
parent 9202:27d800ddc3b0
child 9204:c5a81acc1fc3
comparison
equal deleted inserted replaced
9202:27d800ddc3b0 9203:c65bfddd3cc5
596 if not self:may(node, actor, "get_items") then 596 if not self:may(node, actor, "get_items") then
597 return false, "forbidden"; 597 return false, "forbidden";
598 end 598 end
599 -- 599 --
600 600
601 -- Check node exists and has an item published 601 -- Check node exists
602 if not (self.nodes[node] and self.data[node]) then 602 if not self.nodes[node] then
603 return false, "item-not-found"; 603 return false, "item-not-found";
604 end 604 end
605 605
606 -- Returns success, id, item 606 -- Returns success, id, item
607 return true, self.data[node]:tail(); 607 return true, self.data[node]:tail();