選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. });