Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 7169:d00d8cfcc9a8
mod_storage_sql: Fix setting value to false in map store
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 19 Feb 2016 19:22:18 +0100 |
parent | 7156:18b7ffd08d56 |
child | 7170:fb37aece3252 |
comparison
equal
deleted
inserted
replaced
7167:7ae430fecf12 | 7169:d00d8cfcc9a8 |
---|---|
146 end); | 146 end); |
147 if not ok then return nil, result; end | 147 if not ok then return nil, result; end |
148 return result; | 148 return result; |
149 end | 149 end |
150 function map_store:set(username, key, data) | 150 function map_store:set(username, key, data) |
151 return self:set_keys(username, { [key] = data or self.remove }); | 151 if data == nil then data = self.remove; end |
152 return self:set_keys(username, { [key] = data }); | |
152 end | 153 end |
153 function map_store:set_keys(username, keydatas) | 154 function map_store:set_keys(username, keydatas) |
154 local ok, result = engine:transaction(function() | 155 local ok, result = engine:transaction(function() |
155 for key, data in pairs(keydatas) do | 156 for key, data in pairs(keydatas) do |
156 if type(key) == "string" and key ~= "" then | 157 if type(key) == "string" and key ~= "" then |