diff -r b52663586243 -r e2037634cdd9 plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Mon Nov 06 21:03:30 2017 +0100 +++ b/plugins/mod_pubsub/pubsub.lib.lua Tue Nov 07 00:39:35 2017 +0100 @@ -490,6 +490,13 @@ function get_set:clear() -- luacheck: ignore 212/self return archive:delete(user); end + function get_set:tail() + -- This should conveniently return the last item + local item = self:get(nil); + if item then + return item.attr.id, item; + end + end return setmetatable(get_set, archive); end _M.archive_itemstore = archive_itemstore;