From c832324cb9b9ea13523fc2e839aa5ccf42c70230 Mon Sep 17 00:00:00 2001 From: Lilia Date: Wed, 13 Sep 2017 20:25:51 +0200 Subject: [PATCH] Trigger empty event on keepalive timeout (#1466) --- js/libtextsecure.js | 3 +++ libtextsecure/message_receiver.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 6fb99ece6..ad6db7ce0 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38393,6 +38393,9 @@ MessageReceiver.prototype.extend({ if (ev.code === 3000) { return; } + if (ev.code === 3001) { + this.onEmpty(); + } // possible 403 or network issue. Make an request to confirm return this.server.getDevices(this.number) .then(this.connect.bind(this)) // No HTTP error? Reconnect diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 33b045cb1..b8c66f2b0 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -57,6 +57,9 @@ MessageReceiver.prototype.extend({ if (ev.code === 3000) { return; } + if (ev.code === 3001) { + this.onEmpty(); + } // possible 403 or network issue. Make an request to confirm return this.server.getDevices(this.number) .then(this.connect.bind(this)) // No HTTP error? Reconnect