diff options
author | Kim Alvefur <zash@zash.se> | 2019-08-23 01:04:00 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-08-23 01:04:00 +0200 |
commit | 24670cf607bf3eed29ca79dd4e6b7397773db91b (patch) | |
tree | 4a9ca9970994ac54d23d8733cebb86934d4bd0ea /plugins/mod_storage_sql.lua | |
parent | f93754de4a3bc93dc7fd563eb570b358042ad693 (diff) | |
download | prosody-24670cf607bf3eed29ca79dd4e6b7397773db91b.tar.gz prosody-24670cf607bf3eed29ca79dd4e6b7397773db91b.zip |
mod_storage_*: Tweak :summary API to allow future expansion with more fields
Eg might want to include last message, timestamp, chat state or other info.
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r-- | plugins/mod_storage_sql.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 518e2654..d6779946 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -446,12 +446,14 @@ function archive_store:summary(username, query) return engine:select(sql_query, unpack(args)); end); if not ok then return ok, result end - local summary = {}; + local counts = {}; for row in result do local with, count = row[1], row[2]; - summary[with] = count; + counts[with] = count; end - return summary; + return { + counts = counts; + }; end function archive_store:delete(username, query) |