Skip to content

Commit

Permalink
Merge pull request #251 from Detaysoft/raw-emitter
Browse files Browse the repository at this point in the history
raw:incoming:RID and raw:outgoing:RID added for bosh.
  • Loading branch information
legastero committed Nov 5, 2018
2 parents 92291f8 + 613f8e9 commit 0301c05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/transports/bosh.js
Expand Up @@ -235,6 +235,7 @@ BOSHConnection.prototype.request = function (bosh) {
var body = new Buffer(bosh.toString(), 'utf8').toString();

self.emit('raw:outgoing', body);
self.emit('raw:outgoing:' + ticket.id, body);

self.requests.push(ticket);

Expand All @@ -259,7 +260,10 @@ BOSHConnection.prototype.request = function (bosh) {
});

if (body) {
self.emit('raw:incoming', new Buffer(body, 'utf8').toString());
body = new Buffer(body, 'utf8').toString();

self.emit('raw:incoming', body);
self.emit('raw:incoming:' + ticket.id, body);
}

// do not (re)start long polling if terminating, or request is pending, or before authentication
Expand Down

0 comments on commit 0301c05

Please sign in to comment.