aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_internal.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-31 17:49:51 +0200
committerKim Alvefur <zash@zash.se>2017-03-31 17:49:51 +0200
commit52cff8b4905e24bfeabcc088d82c08c09e347f5e (patch)
tree354dae3f6da4b4fca4dd4e4850d45e3c094c55c3 /plugins/mod_storage_internal.lua
parent8be8224bbacc9de5cfbb11a566c85aa2eca1f8dc (diff)
downloadprosody-52cff8b4905e24bfeabcc088d82c08c09e347f5e.tar.gz
prosody-52cff8b4905e24bfeabcc088d82c08c09e347f5e.zip
mod_storage_internal: Add the dates method
Diffstat (limited to 'plugins/mod_storage_internal.lua')
-rw-r--r--plugins/mod_storage_internal.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index c1e460eb..09760838 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -120,6 +120,12 @@ function archive:find(username, query)
end, count;
end
+function archive:dates(username)
+ local items, err = datamanager.list_load(username, host, self.store);
+ if not items then return items, err; end
+ return array(items):pluck("when"):map(datetime.date):unique();
+end
+
function archive:delete(username, query)
if not query or next(query) == nil then
return datamanager.list_store(username, host, self.store, nil);