Simplify keepalive resets

Websocket resources should have their keepalive timers reset whenever a
message comes in. This is a nicety that slightly reduces the amount of
traffic we send when actively messaging.

Previously this was handled by MessageReceiver, but it's a bit cleaner
to just have the WebsocketResource add an extra 'message' event handler.

// FREEBIE
This commit is contained in:
lilia 2015-10-23 14:43:15 -07:00
parent 5a8787f91a
commit 9be5efc571
3 changed files with 6 additions and 6 deletions

View file

@ -53,7 +53,6 @@ MessageReceiver.prototype = {
});
},
handleRequest: function(request) {
this.wsr.resetKeepAliveTimer();
// TODO: handle different types of requests. for now we only expect
// PUT /messages <encrypted IncomingPushMessageSignal>
textsecure.crypto.decryptWebsocketMessage(request.body, this.signalingKey).then(function(plaintext) {