You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

estos_log.js 573B

12345678910111213141516
  1. Strophe.addConnectionPlugin('logger', {
  2. // logs raw stanzas and makes them available for download as JSON
  3. connection: null,
  4. log: [],
  5. init: function (conn) {
  6. this.connection = conn;
  7. this.connection.rawInput = this.log_incoming.bind(this);;
  8. this.connection.rawOutput = this.log_outgoing.bind(this);;
  9. },
  10. log_incoming: function (stanza) {
  11. this.log.push([new Date().getTime(), 'incoming', stanza]);
  12. },
  13. log_outgoing: function (stanza) {
  14. this.log.push([new Date().getTime(), 'outgoing', stanza]);
  15. },
  16. });