Software /
code /
prosody
Changeset
6737:9f932a31eeba
mod_storage_sql2: Some reformatting and variable name improvements
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 24 Jun 2015 22:55:41 +0100 |
parents | 6736:4aee55c0cc5c |
children | 6738:845bc5ba306d |
files | plugins/mod_storage_sql2.lua |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_storage_sql2.lua Wed Jun 24 22:54:17 2015 +0100 +++ b/plugins/mod_storage_sql2.lua Wed Jun 24 22:55:41 2015 +0100 @@ -197,7 +197,7 @@ local keyval_store = {}; keyval_store.__index = keyval_store; function keyval_store:get(username) - user,store = username,self.store; + user, store = username, self.store; local ok, result = engine:transaction(keyval_store_get); if not ok then return ok, result; end return result; @@ -361,13 +361,13 @@ end function driver:stores(username) - local sql = "SELECT DISTINCT `store` FROM `prosody` WHERE `host`=? AND `user`" .. + local query = "SELECT DISTINCT `store` FROM `prosody` WHERE `host`=? AND `user`" .. (username == true and "!=?" or "=?"); if username == true or not username then username = ""; end local ok, result = engine:transaction(function() - return engine:select(sql, host, username); + return engine:select(query, host, username); end); if not ok then return ok, result end return iterator(result); @@ -376,7 +376,7 @@ function driver:purge(username) return engine:transaction(function() local stmt,err = engine:delete("DELETE FROM `prosody` WHERE `host`=? AND `user`=?", host, username); - return true,err; + return true, err; end); end