Commit fe00fd4f authored by JC Brand's avatar JC Brand

Emit an event when sending a stanza

parent e0f06176
...@@ -1641,6 +1641,7 @@ _converse.api = { ...@@ -1641,6 +1641,7 @@ _converse.api = {
*/ */
'send' (stanza) { 'send' (stanza) {
_converse.connection.send(stanza); _converse.connection.send(stanza);
_converse.emit('send', stanza);
}, },
/** /**
...@@ -1653,6 +1654,7 @@ _converse.api = { ...@@ -1653,6 +1654,7 @@ _converse.api = {
'sendIQ' (stanza) { 'sendIQ' (stanza) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_converse.connection.sendIQ(stanza, resolve, reject, _converse.IQ_TIMEOUT); _converse.connection.sendIQ(stanza, resolve, reject, _converse.IQ_TIMEOUT);
_converse.emit('send', stanza);
}); });
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment