aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-27 19:43:57 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-27 19:43:57 +0500
commita4d4abfeb78ff6e1de6d669679e78b6c88ed77e1 (patch)
tree7f6e741e550cd1d6a82824bc3c561b2b9bbb42b0
parent82573c9d239937a6d5b7f976f9f149aaa47d0f94 (diff)
downloadprosody-a4d4abfeb78ff6e1de6d669679e78b6c88ed77e1.tar.gz
prosody-a4d4abfeb78ff6e1de6d669679e78b6c88ed77e1.zip
mod_storage_sql: Use util.json instead of util.serialization.
-rw-r--r--plugins/mod_storage_sql.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 75080726..53f1ea0a 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -25,7 +25,7 @@ local tonumber = tonumber;
local pairs = pairs;
local next = next;
local setmetatable = setmetatable;
-local json = { stringify = function(s) return require"util.serialization".serialize(s) end, parse = require"util.serialization".deserialize };
+local json = require "util.json";
local connection = ...;
local host,user,store = module.host;
@@ -59,7 +59,7 @@ do -- process options to get a db connection
module:log("debug", "Initialized new SQLite3 database");
end
assert(connection:commit());
- --print("===", json.stringify())
+ --print("===", json.encode())
end
end
@@ -68,7 +68,7 @@ local function serialize(value)
if t == "string" or t == "boolean" or t == "number" then
return t, tostring(value);
elseif t == "table" then
- local value,err = json.stringify(value);
+ local value,err = json.encode(value);
if value then return "json", value; end
return nil, err;
end
@@ -81,7 +81,7 @@ local function deserialize(t, value)
elseif value == "false" then return false; end
elseif t == "number" then return tonumber(value);
elseif t == "json" then
- return json.parse(value);
+ return json.decode(value);
end
end