plugins/smacks.lua

changeset 320
e04f10664704
parent 250
a5ac643a7fd6
child 321
369d4638d775
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

mercurial