Software /
code /
verse
Comparison
plugins/smacks.lua @ 320:e04f10664704
plugins.smacks: Break less on sending of non-stanzas such as raw strings.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 Feb 2013 00:10:19 +0100 |
parent | 250:a5ac643a7fd6 |
child | 321:369d4638d775 |
comparison
equal
deleted
inserted
replaced
319:12b0e5cc72bf | 320:e04f10664704 |
---|---|
51 stream.smacks = true; | 51 stream.smacks = true; |
52 -- Catch outgoing stanzas | 52 -- Catch outgoing stanzas |
53 local old_send = stream.send; | 53 local old_send = stream.send; |
54 function stream.send(stream, stanza) | 54 function stream.send(stream, stanza) |
55 stream:warn("SENDING"); | 55 stream:warn("SENDING"); |
56 if not stanza.attr.xmlns then | 56 if stanza.name and not stanza.attr.xmlns then |
57 outgoing_queue[#outgoing_queue+1] = stanza; | 57 outgoing_queue[#outgoing_queue+1] = stanza; |
58 local ret = old_send(stream, stanza); | 58 local ret = old_send(stream, stanza); |
59 old_send(stream, verse.stanza("r", { xmlns = xmlns_sm })); | 59 old_send(stream, verse.stanza("r", { xmlns = xmlns_sm })); |
60 return ret; | 60 return ret; |
61 end | 61 end |