# HG changeset patch # User Kim Alvefur # Date 1542043599 -3600 # Node ID f85e12d9eedeb95139f0832be91f8acea910e4c3 # Parent 655b8d36a8a4ab3f22b6d95930c4f241edcfc08f# Parent ddcb28c8f64bf049e83858c0ff9a79b061713bef Merge 0.11->trunk diff -r 655b8d36a8a4 -r f85e12d9eede plugins/mod_scansion_record.lua --- a/plugins/mod_scansion_record.lua Sun Nov 11 02:31:09 2018 +0100 +++ b/plugins/mod_scansion_record.lua Mon Nov 12 18:26:39 2018 +0100 @@ -6,6 +6,7 @@ local id = require "util.id"; local dt = require "util.datetime"; local dm = require "util.datamanager"; +local st = require "util.stanza"; local record_id = id.medium():lower(); local record_date = os.date("%Y%b%d"):lower(); @@ -36,12 +37,16 @@ end local function record_stanza(stanza, session, verb) - record(session.scansion_id.." "..verb..":\n\t"..tostring(stanza).."\n\n"); + local flattened = tostring(stanza):gsub("><", ">\n\t<"); + -- TODO Proper prettyprinting with indentation + record(session.scansion_id.." "..verb..":\n\t"..flattened.."\n\n"); end local function record_stanza_in(stanza, session) if stanza.attr.xmlns == nil then - record_stanza(stanza, session, "sends") + local copy = st.clone(stanza); + copy.attr.from = nil; + record_stanza(copy, session, "sends") end return stanza; end @@ -49,7 +54,11 @@ local function record_stanza_out(stanza, session) if stanza.attr.xmlns == nil then if not (stanza.name == "iq" and stanza:get_child("bind", "urn:ietf:params:xml:ns:xmpp-bind")) then - record_stanza(stanza, session, "receives"); + local copy = st.clone(stanza); + if copy.attr.to == session.full_jid then + copy.attr.to = nil; + end + record_stanza(copy, session, "receives"); end end return stanza; diff -r 655b8d36a8a4 -r f85e12d9eede spec/scansion/muc_whois_anyone_member.scs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/scansion/muc_whois_anyone_member.scs Mon Nov 12 18:26:39 2018 +0100 @@ -0,0 +1,101 @@ +# MUC: Allow members to fetch the affiliation lists in open non-anonymous rooms + +[Client] Romeo + jid: romeo@localhost/MsliYo9C + password: password + +[Client] Juliet + jid: juliet@localhost/vJrUtY4Z + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + + + +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + anyone + + + + + +Romeo receives: + + +Romeo receives: + + + + + + +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + + + + + +Juliet receives: + + + + + + + + +Juliet receives: + + + + +Juliet sends: + + + + + + +Juliet receives: + + + + +Juliet disconnects + +Romeo disconnects + diff -r 655b8d36a8a4 -r f85e12d9eede spec/scansion/prosody.cfg.lua --- a/spec/scansion/prosody.cfg.lua Sun Nov 11 02:31:09 2018 +0100 +++ b/spec/scansion/prosody.cfg.lua Mon Nov 12 18:26:39 2018 +0100 @@ -42,6 +42,7 @@ --"motd"; -- Send a message to users when they log in --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots. --"proxy65"; -- Enables a file transfer proxy service which clients behind NAT can use + --"scansion_record"; } certificate = "certs"