Software /
code /
prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 8399:07443fe9df5b
mod_pubsub/archive_itemstore: Support resize operation
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 09 Nov 2017 17:21:50 +0100 |
parent | 8375:e2037634cdd9 |
child | 8400:518b56d806bd |
comparison
equal
deleted
inserted
replaced
8398:3eff1b60269a | 8399:07443fe9df5b |
---|---|
488 return data; | 488 return data; |
489 end | 489 end |
490 function get_set:clear() -- luacheck: ignore 212/self | 490 function get_set:clear() -- luacheck: ignore 212/self |
491 return archive:delete(user); | 491 return archive:delete(user); |
492 end | 492 end |
493 function get_set:resize(size) | |
494 return archive:delete(user, { | |
495 truncate = size; | |
496 }); | |
497 end | |
493 function get_set:tail() | 498 function get_set:tail() |
494 -- This should conveniently return the last item | 499 -- This should conveniently return the last item |
495 local item = self:get(nil); | 500 local item = self:get(nil); |
496 if item then | 501 if item then |
497 return item.attr.id, item; | 502 return item.attr.id, item; |