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 |