projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
certmanager: Add locals for ssl.context and ssl.x509
[prosody.git]
/
core
/
rostermanager.lua
diff --git
a/core/rostermanager.lua
b/core/rostermanager.lua
index fdb890f96b5002a9278e3488b304b5d0bd8fa03a..8c7612b450fe697fe21b81f9400c004b39743c51 100644
(file)
--- a/
core/rostermanager.lua
+++ b/
core/rostermanager.lua
@@
-1,7
+1,7
@@
-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
---
+--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
@@
-11,16
+11,14
@@
local log = require "util.logger".init("rostermanager");
local log = require "util.logger".init("rostermanager");
-local setmetatable = setmetatable;
-local format = string.format;
-local pcall = pcall;
-local pairs, ipairs = pairs, ipairs;
+local pairs = pairs;
local tostring = tostring;
local hosts = hosts;
local tostring = tostring;
local hosts = hosts;
-local bare_sessions = bare_sessions;
+local bare_sessions =
prosody.
bare_sessions;
local datamanager = require "util.datamanager"
local datamanager = require "util.datamanager"
+local um_user_exists = require "core.usermanager".user_exists;
local st = require "util.stanza";
module "rostermanager"
local st = require "util.stanza";
module "rostermanager"
@@
-102,12
+100,17
@@
function load_roster(username, host)
log("warn", "roster for %s has a self-contact", jid);
end
if not err then
log("warn", "roster for %s has a self-contact", jid);
end
if not err then
- hosts[host].events.fire_event("roster-load",
username, host, roster
);
+ hosts[host].events.fire_event("roster-load",
{ username = username, host = host, roster = roster }
);
end
return roster, err;
end
function save_roster(username, host, roster)
end
return roster, err;
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;
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;