# HG changeset patch # User Kim Alvefur # Date 1491066294 -7200 # Node ID ef838b7f8f53fb101f3214bcd8126e4fa0a2d493 # Parent bd3527198308acc3c1bfa4ad356c08893d258286 mod_storage_sql: Sensible defaults for 'when' and 'with' arguments diff -r bd3527198308 -r ef838b7f8f53 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Sat Apr 01 19:04:15 2017 +0200 +++ b/plugins/mod_storage_sql.lua Sat Apr 01 19:04:54 2017 +0200 @@ -184,6 +184,8 @@ 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);