diff options
author | Marco Cirillo <maranda@lightwitch.org> | 2013-04-05 04:52:11 +0000 |
---|---|---|
committer | Marco Cirillo <maranda@lightwitch.org> | 2013-04-05 04:52:11 +0000 |
commit | 123fef628e6b8ba0da52a05d9186cddcc265ccec (patch) | |
tree | 0b8fcb39f0a2b43d4dcbb772b2937091f8590ae3 | |
parent | 23fdba8f6bd0d7a0b98d6b8b61fdf6207e6785e2 (diff) | |
download | prosody-123fef628e6b8ba0da52a05d9186cddcc265ccec.tar.gz prosody-123fef628e6b8ba0da52a05d9186cddcc265ccec.zip |
rostermanager: do not save rosters for unexistant users.
-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; |