diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-06-23 15:58:56 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-06-23 15:58:56 +0100 |
commit | f00a5d70b30b132b763b2e20c68accb8ce52789d (patch) | |
tree | 0741204836fedee0caea15f4607bd996d7e5fdab /core/rostermanager.lua | |
parent | 3f141a44c2b4564e5d88748f76f53f5fec6c1a33 (diff) | |
parent | 54bbd9c98aa6e40463982ec2a92fa9a444704b43 (diff) | |
download | prosody-f00a5d70b30b132b763b2e20c68accb8ce52789d.tar.gz prosody-f00a5d70b30b132b763b2e20c68accb8ce52789d.zip |
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r-- | core/rostermanager.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 867add2c..514d3d8e 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -82,19 +82,24 @@ end function load_roster(username, host) log("debug", "load_roster: asked for: "..username.."@"..host); + local roster; if hosts[host] and hosts[host].sessions[username] then - local roster = hosts[host].sessions[username].roster; + roster = hosts[host].sessions[username].roster; if not roster then log("debug", "load_roster: loading for new user: "..username.."@"..host); roster = datamanager.load(username, host, "roster") or {}; if not roster[false] then roster[false] = { }; end hosts[host].sessions[username].roster = roster; + hosts[host].events.fire_event("roster-load", username, host, roster); end return roster; end + -- Attempt to load roster for non-loaded user log("debug", "load_roster: loading for offline user: "..username.."@"..host); - return datamanager.load(username, host, "roster") or {}; + roster = datamanager.load(username, host, "roster") or {}; + hosts[host].events.fire_event("roster-load", username, host, roster); + return roster; end function save_roster(username, host) |