diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-07-02 21:34:45 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-07-02 21:34:45 +0500 |
commit | 9dd7b702f080143c9ef72c6ad5efd5af30a793f0 (patch) | |
tree | de1644446e5bfe8f3bffca0b33507ce6c1d5a6b9 /util | |
parent | f101f253b403e4b36a6c7b59ab9a6ef51df5ad71 (diff) | |
download | prosody-9dd7b702f080143c9ef72c6ad5efd5af30a793f0.tar.gz prosody-9dd7b702f080143c9ef72c6ad5efd5af30a793f0.zip |
datamanager: Fixed incorrect callback result checking
Diffstat (limited to 'util')
-rw-r--r-- | util/datamanager.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index 54cf1959..8e4b7828 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -62,7 +62,7 @@ end 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 @@ function store(username, host, datastore, data) 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 @@ end 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 @@ function list_store(username, host, datastore, data) 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 |