Software /
code /
prosody
Comparison
plugins/mod_scansion_record.lua @ 9358:bbc24fc734da
mod_scansion_record: Only record stanzas in the default namespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Sep 2018 14:19:22 +0200 |
parent | 9357:0ae20fb3d4c6 |
child | 9359:dc55d7d2798b |
comparison
equal
deleted
inserted
replaced
9357:0ae20fb3d4c6 | 9358:bbc24fc734da |
---|---|
22 local function record_stanza(stanza, session, verb) | 22 local function record_stanza(stanza, session, verb) |
23 record(session.scansion_id.." "..verb..":\n\t"..tostring(stanza).."\n\n"); | 23 record(session.scansion_id.." "..verb..":\n\t"..tostring(stanza).."\n\n"); |
24 end | 24 end |
25 | 25 |
26 local function record_stanza_in(stanza, session) | 26 local function record_stanza_in(stanza, session) |
27 record_stanza(stanza, session, "sends") | 27 if stanza.attr.xmlns == nil then |
28 record_stanza(stanza, session, "sends") | |
29 end | |
28 return stanza; | 30 return stanza; |
29 end | 31 end |
30 | 32 |
31 local function record_stanza_out(stanza, session) | 33 local function record_stanza_out(stanza, session) |
32 record_stanza(stanza, session, "receives") | 34 if stanza.attr.xmlns == nil then |
35 record_stanza(stanza, session, "receives"); | |
36 end | |
33 return stanza; | 37 return stanza; |
34 end | 38 end |
35 | 39 |
36 module:hook("resource-bind", function (event) | 40 module:hook("resource-bind", function (event) |
37 local session = event.session; | 41 local session = event.session; |