Sat, 19 Sep 2015 21:49:03 +0100
client: More flexible handling of whitespace in stanzas in script
scansion/objects/client.lua | file | annotate | diff | comparison | revisions |
--- a/scansion/objects/client.lua Sat Sep 19 21:48:26 2015 +0100 +++ b/scansion/objects/client.lua Sat Sep 19 21:49:03 2015 +0100 @@ -48,12 +48,12 @@ end; sends = function (client, data) - local stanza = fill_vars(client.script, parse_xml(table.concat(data))); + local stanza = fill_vars(client.script, assert(parse_xml((table.concat(data):gsub("\t", " "))))); client.stream:send(stanza); end; receives = function (client, data) - local expected_stanza = fill_vars(client.script, parse_xml(table.concat(data))); + local expected_stanza = fill_vars(client.script, assert(parse_xml((table.concat(data):gsub("\t", " "))))); local function stanza_handler(received_stanza) if not stanzacmp.stanzas_match(expected_stanza, received_stanza) then verse.quit();