aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-29 02:05:19 +0200
committerKim Alvefur <zash@zash.se>2017-10-29 02:05:19 +0200
commit5618526b318176613e65df2bff62db6fa7bb9520 (patch)
tree0d8a66dad4d8c64d5cfab32c11132b2c0e1ca301 /core/rostermanager.lua
parent2455838c48d42e5d60239dcc863bd60df8ba16c3 (diff)
parent97b8c701176a111587239b7927a485c81c9ce0b0 (diff)
downloadprosody-5618526b318176613e65df2bff62db6fa7bb9520.tar.gz
prosody-5618526b318176613e65df2bff62db6fa7bb9520.zip
Merge 0.10->trunk
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r--core/rostermanager.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index c94482c4..f6a44028 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -104,9 +104,9 @@ local function load_roster(username, host)
if user then
roster = user.roster;
if roster then return roster; end
- log("debug", "load_roster: loading for new user: %s@%s", username, host);
+ log("debug", "load_roster: loading for new user: %s", jid);
else -- Attempt to load roster for non-loaded user
- log("debug", "load_roster: loading for offline user: %s@%s", username, host);
+ log("debug", "load_roster: loading for offline user: %s", jid);
end
local roster_store = storagemanager.open(host, "roster", "keyval");
local data, err = roster_store:get(username);
@@ -115,7 +115,10 @@ local function load_roster(username, host)
roster_metadata(roster, err);
if roster[jid] then
roster[jid] = nil;
- log("warn", "roster for %s has a self-contact", jid);
+ log("debug", "Roster for %s had a self-contact, removing", jid);
+ if not save_roster(username, host, roster, jid) then
+ log("warn", "Could not remove self-contact from roster for %s", jid);
+ end
end
if not err then
hosts[host].events.fire_event("roster-load", { username = username, host = host, roster = roster });