From 4c39528a445dd5911e91b183c24a42febf0b840b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 26 Oct 2017 22:30:52 +0200 Subject: loggingmanager: Make timestamps enabled by default in file sink (fixes #1004) --- core/loggingmanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index 6dc1c1d1..004f4c3b 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -178,7 +178,7 @@ local function log_to_file(sink_config, logfile) local timestamps = sink_config.timestamps; - if timestamps == true then + if timestamps == true or timestamps == nil then timestamps = default_timestamp; -- Default format elseif timestamps then timestamps = timestamps .. " "; -- cgit v1.2.3 From 519ef501d24ebe62477916816d782d6a8ad437f6 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 19 Sep 2017 19:17:07 +0200 Subject: rostermanager: Simplify logging. --- core/rostermanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index c94482c4..04f97f22 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); -- cgit v1.2.3 From 67e92afe782fc6ce3711b7c3aca7acc613d6f2a3 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 19 Sep 2017 19:17:23 +0200 Subject: rostermanager: Remove self-contact entry (fixes #933) --- core/rostermanager.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 04f97f22..ac5104c3 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -115,7 +115,8 @@ 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("warn", "roster for %s had a self-contact, removing", jid); + roster_store:set(username, roster); end if not err then hosts[host].events.fire_event("roster-load", { username = username, host = host, roster = roster }); -- cgit v1.2.3 From bf3bb71ed6a3fea069d4f72c8603bfa8ae306641 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Oct 2017 00:05:26 +0200 Subject: rostermanager: Capitalize log message --- core/rostermanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index ac5104c3..32de3a54 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -115,7 +115,7 @@ local function load_roster(username, host) roster_metadata(roster, err); if roster[jid] then roster[jid] = nil; - log("warn", "roster for %s had a self-contact, removing", jid); + log("warn", "Roster for %s had a self-contact, removing", jid); roster_store:set(username, roster); end if not err then -- cgit v1.2.3 From 314beadb4bbb61e026bfea4b07f72b2b28d4976d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Oct 2017 00:06:26 +0200 Subject: rostermanager: Demote warning to debug message --- core/rostermanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 32de3a54..6acc1003 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -115,7 +115,7 @@ local function load_roster(username, host) roster_metadata(roster, err); if roster[jid] then roster[jid] = nil; - log("warn", "Roster for %s had a self-contact, removing", jid); + log("debug", "Roster for %s had a self-contact, removing", jid); roster_store:set(username, roster); end if not err then -- cgit v1.2.3 From 04bdf078d399e9b0578b9f13f22fab2e8f96fd50 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Oct 2017 00:07:18 +0200 Subject: rostermanager: Use internal method for storing removal of self-contact --- core/rostermanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 6acc1003..dda69e7c 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -116,7 +116,7 @@ local function load_roster(username, host) if roster[jid] then roster[jid] = nil; log("debug", "Roster for %s had a self-contact, removing", jid); - roster_store:set(username, roster); + save_roster(username, host, roster, jid); end if not err then hosts[host].events.fire_event("roster-load", { username = username, host = host, roster = roster }); -- cgit v1.2.3 From efcd11b5412ffae04c6cab377c1a5a757ca1acb9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Oct 2017 00:07:45 +0200 Subject: rostermanager: Log warning if removal self-contact failed --- core/rostermanager.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index dda69e7c..f6a44028 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -116,7 +116,9 @@ local function load_roster(username, host) if roster[jid] then roster[jid] = nil; log("debug", "Roster for %s had a self-contact, removing", jid); - save_roster(username, host, roster, 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 }); -- cgit v1.2.3