Software /
code /
prosody
Diff
util/datamanager.lua @ 1462:44780b856ce7
datamanager: Fixed incorrect callback result checking
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 02 Jul 2009 21:34:45 +0500 |
parent | 1381:46a58df8557d |
child | 1523:841d61be198f |
line wrap: on
line diff
--- a/util/datamanager.lua Thu Jul 02 15:43:27 2009 +0100 +++ b/util/datamanager.lua Thu Jul 02 21:34:45 2009 +0500 @@ -62,7 +62,7 @@ local function callback(username, host, datastore, data) for _, f in ipairs(callbacks) do username, host, datastore, data = f(username, host, datastore, data); - if not username then break; end + if username == false then break; end end return username, host, datastore, data; @@ -123,7 +123,7 @@ end username, host, datastore, data = callback(username, host, datastore, data); - if not username then + if username == false then return true; -- Don't save this data at all end @@ -147,7 +147,7 @@ function list_append(username, host, datastore, data) if not data then return; end - if callback and callback(username, host, datastore) then return true; end + if callback(username, host, datastore) == false then return true; end -- save the datastore local f, msg = io_open(getpath(username, host, datastore, "list", true), "a+"); if not f then @@ -165,7 +165,7 @@ if not data then data = {}; end - if callback and callback(username, host, datastore) then return true; end + if callback(username, host, datastore) == false then return true; end -- save the datastore local f, msg = io_open(getpath(username, host, datastore, "list", true), "w+"); if not f then