Only retry messages on startup, not every sockect reconnect (#1510)
FREEBIE
This commit is contained in:
parent
2d650bd627
commit
95c85010c4
3 changed files with 29 additions and 11 deletions
|
@ -38356,7 +38356,9 @@ var TextSecureServer = (function() {
|
|||
* vim: ts=4:sw=4:expandtab
|
||||
*/
|
||||
|
||||
function MessageReceiver(url, username, password, signalingKey) {
|
||||
function MessageReceiver(url, username, password, signalingKey, options) {
|
||||
options = options || {};
|
||||
|
||||
this.count = 0;
|
||||
|
||||
this.url = url;
|
||||
|
@ -38368,6 +38370,12 @@ function MessageReceiver(url, username, password, signalingKey) {
|
|||
var address = libsignal.SignalProtocolAddress.fromString(username);
|
||||
this.number = address.getName();
|
||||
this.deviceId = address.getDeviceId();
|
||||
|
||||
this.pending = Promise.resolve();
|
||||
|
||||
if (options.retryCached) {
|
||||
this.pending = this.queueAllCached();
|
||||
}
|
||||
}
|
||||
|
||||
MessageReceiver.prototype = new textsecure.EventTarget();
|
||||
|
@ -38387,8 +38395,6 @@ MessageReceiver.prototype.extend({
|
|||
keepalive: { path: '/v1/keepalive', disconnect: true }
|
||||
});
|
||||
|
||||
this.pending = this.queueAllCached();
|
||||
|
||||
// Ensures that an immediate 'empty' event from the websocket will fire only after
|
||||
// all cached envelopes are processed.
|
||||
this.incoming = [this.pending];
|
||||
|
@ -39211,8 +39217,8 @@ MessageReceiver.prototype.extend({
|
|||
|
||||
window.textsecure = window.textsecure || {};
|
||||
|
||||
textsecure.MessageReceiver = function(url, username, password, signalingKey) {
|
||||
var messageReceiver = new MessageReceiver(url, username, password, signalingKey);
|
||||
textsecure.MessageReceiver = function(url, username, password, signalingKey, options) {
|
||||
var messageReceiver = new MessageReceiver(url, username, password, signalingKey, options);
|
||||
this.addEventListener = messageReceiver.addEventListener.bind(messageReceiver);
|
||||
this.removeEventListener = messageReceiver.removeEventListener.bind(messageReceiver);
|
||||
this.getStatus = messageReceiver.getStatus.bind(messageReceiver);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue