aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-01 19:04:54 +0200
committerKim Alvefur <zash@zash.se>2017-04-01 19:04:54 +0200
commitb33ad7f001f8242a828e11e9c225346f4aadd81b (patch)
tree54476d39667e434ad96e85fb6cce408fea1b6fcc /plugins
parent0e5546ccf1433220ef102f4da71eaa9b1880a074 (diff)
downloadprosody-b33ad7f001f8242a828e11e9c225346f4aadd81b.tar.gz
prosody-b33ad7f001f8242a828e11e9c225346f4aadd81b.zip
mod_storage_sql: Sensible defaults for 'when' and 'with' arguments
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_sql.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index f48c7ae9..122a673a 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -184,6 +184,8 @@ archive_store.caps = {
archive_store.__index = archive_store
function archive_store:append(username, key, value, when, with)
local user,store = username,self.store;
+ when = when or os.time();
+ with = with or "";
local ok, key = engine:transaction(function()
if key then
engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key);