From 2e7e1a301c23d055090c7926e06b58a0049da563 Mon Sep 17 00:00:00 2001 From: Jonas Wielicki Date: Sat, 9 Dec 2017 17:36:47 +0100 Subject: MUC: fix the @from on in history replay (fixes #1054) --- plugins/muc/muc.lib.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 4b299bde..0dfdd1aa 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -135,8 +135,8 @@ function room_mt:broadcast_message(stanza, historic) stanza = st.clone(stanza); stanza.attr.to = ""; local stamp = datetime.datetime(); - stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = muc_domain, stamp = stamp}):up(); -- XEP-0203 - stanza:tag("x", {xmlns = "jabber:x:delay", from = muc_domain, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) + stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = self.jid, stamp = stamp}):up(); -- XEP-0203 + stanza:tag("x", {xmlns = "jabber:x:delay", from = self.jid, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) local entry = { stanza = stanza, stamp = stamp }; t_insert(history, entry); while #history > (self._data.history_length or default_history_length) do t_remove(history, 1) end -- cgit v1.2.3 From 1e1a96fa4c6c3b273a0710ed6263b975eebb624e Mon Sep 17 00:00:00 2001 From: Jonas Wielicki Date: Sat, 9 Dec 2017 17:57:14 +0100 Subject: MUC: Ensure that elements which match our from are stripped (fixes #1055) --- plugins/muc/muc.lib.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 0dfdd1aa..0040b99c 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -122,6 +122,22 @@ function room_mt:broadcast_presence(stanza, sid, code, nick) end function room_mt:broadcast_message(stanza, historic) local to = stanza.attr.to; + local muc_jid = self.jid; + + stanza:maptags(function (child) + if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then + if child.attr["from"] == muc_jid then + return nil; + end + end + if child.name == "x" and child.attr["xmlns"] == "jabber:x:delay" then + if child.attr["from"] == muc_jid then + return nil; + end + end + return child; + end) + for occupant, o_data in pairs(self._occupants) do for jid in pairs(o_data.sessions) do stanza.attr.to = jid; -- cgit v1.2.3 From d993a7515e9ff0b90015493b27e7f7ff3e625793 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 10 Dec 2017 17:52:47 +0100 Subject: MUC: Rename variable to make it clearer that it is the room JID and not the MUC host --- plugins/muc/muc.lib.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 0040b99c..e8d565f2 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -122,16 +122,16 @@ function room_mt:broadcast_presence(stanza, sid, code, nick) end function room_mt:broadcast_message(stanza, historic) local to = stanza.attr.to; - local muc_jid = self.jid; + local room_jid = self.jid; stanza:maptags(function (child) if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then - if child.attr["from"] == muc_jid then + if child.attr["from"] == room_jid then return nil; end end if child.name == "x" and child.attr["xmlns"] == "jabber:x:delay" then - if child.attr["from"] == muc_jid then + if child.attr["from"] == room_jid then return nil; end end -- cgit v1.2.3 From cf3af7a85ce0f7df439bd44421b7581f24aeea64 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 12 Dec 2017 01:40:09 +0100 Subject: mod_storage_sql: Index over contact and timestamp (happy now Ge0rg?) --- plugins/mod_storage_sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index e25cb5c6..13c961f8 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -452,7 +452,7 @@ local function create_table(engine, name) -- luacheck: ignore 431/engine Column { name="type", type="TEXT", nullable=false }; Column { name="value", type="MEDIUMTEXT", nullable=false }; Index { name="prosodyarchive_index", unique = true, "host", "user", "store", "key" }; - Index { name="prosodyarchive_with", "host", "user", "store", "with" }; + Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" }; Index { name="prosodyarchive_when", "host", "user", "store", "when" }; }; engine:transaction(function() -- cgit v1.2.3 From 2d4c94e612c88e608c8b94980b6af34884ca6eb8 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 21 Dec 2017 10:15:47 +0100 Subject: mod_saslauth: Log which mechanisms are offered --- plugins/mod_saslauth.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 81400e45..b5ec4057 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -263,6 +263,7 @@ module:hook("stream-features", function(event) elseif not origin.secure and insecure_mechanisms:contains(mechanism) then log("debug", "Not offering mechanism %s on insecure connection", mechanism); else + log("debug", "Offering mechanism %s", mechanism); mechanisms:tag("mechanism"):text(mechanism):up(); end end -- cgit v1.2.3