diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-05 10:05:18 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-05 10:05:18 +0100 |
commit | fc2ce67b3159f5d5b35b8109f5c2c11fc8b37c99 (patch) | |
tree | 60c4be5a40bd2c13dcfb8435083d1b23619523a4 /core/rostermanager.lua | |
parent | 1213909d149d2ae2d697d6694ee1a30ef41c47f4 (diff) | |
parent | c84e9926d2d60a8587c1e57daa37baad489585b5 (diff) | |
download | prosody-fc2ce67b3159f5d5b35b8109f5c2c11fc8b37c99.tar.gz prosody-fc2ce67b3159f5d5b35b8109f5c2c11fc8b37c99.zip |
Merge 0.9->trunk
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r-- | core/rostermanager.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index f14bb435..5e06e3f7 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -18,6 +18,7 @@ local hosts = hosts; local bare_sessions = bare_sessions; local datamanager = require "util.datamanager" +local um_user_exists = require "core.usermanager".user_exists; local st = require "util.stanza"; module "rostermanager" @@ -105,6 +106,11 @@ function load_roster(username, host) end function save_roster(username, host, roster) + if not um_user_exists(username, host) then + log("debug", "not saving roster for %s@%s: the user doesn't exist", username, host); + return nil; + end + log("debug", "save_roster: saving roster for %s@%s", username, host); if not roster then roster = hosts[host] and hosts[host].sessions[username] and hosts[host].sessions[username].roster; |