aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-10-14 07:20:29 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-10-14 07:20:29 +0500
commit1cdd0be85d25c04e7e634f683f96206d808a3e7b (patch)
tree9e5f7a513ed83dc1f7b4e76f714c456ac8406cce
parentbbff39858de6bb4c7c2714c658856e9d7b32dd6f (diff)
downloadprosody-1cdd0be85d25c04e7e634f683f96206d808a3e7b.tar.gz
prosody-1cdd0be85d25c04e7e634f683f96206d808a3e7b.zip
Fixed: Typos caused by lack of sleep.
Learned: Lua variable assignments are not expressions.
-rw-r--r--core/rostermanager.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index 1097e327..e16525da 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -8,6 +8,8 @@ local setmetatable = setmetatable;
local format = string.format;
local loadfile, setfenv, pcall = loadfile, setfenv, pcall;
+local hosts = hosts;
+
require "util.datamanager"
local datamanager = datamanager;
@@ -35,18 +37,19 @@ function remove_from_roster(roster, jid)
-- TODO implement
end
-function load_roster(host, username)
+function load_roster(username, host)
if hosts[host] and hosts[host].sessions[username] then
local roster = hosts[host].sessions[username].roster;
if not roster then
- return hosts[host].sessions[username].roster = datamanger.load(username, host, "roster") or {};
+ roster = datamanager.load(username, host, "roster") or {};
+ hosts[host].sessions[username].roster = roster;
end
return roster;
end
error("Attempt to load roster for non-loaded user"); --return nil;
end
-function save_roster(host, username)
+function save_roster(username, host)
if hosts[host] and hosts[host].sessions[username] and hosts[host].sessions[username].roster then
return datamanager.save(username, host, "roster", hosts[host].sessions[username].roster);
end