From 80c6a2802fbe86ab5d0abf1b525a7edbaa5eb986 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 24 Jun 2016 17:21:44 -0700 Subject: [PATCH] Handle sync request where no groups are sent If a user has no groups, no group sync message is sent. This is a normal result that should result in a success event rather than a timeout. // FREEBIE --- js/libtextsecure.js | 6 +++++- libtextsecure/sync_request.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 5d85d45b..950b244c 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -39120,7 +39120,11 @@ textsecure.MessageSender.prototype = { } }, onTimeout: function() { - this.dispatchEvent(new Event('timeout')); + if (this.contactSync || this.groupSync) { + this.dispatchEvent(new Event('success')); + } else { + this.dispatchEvent(new Event('timeout')); + } this.cleanup(); }, cleanup: function() { diff --git a/libtextsecure/sync_request.js b/libtextsecure/sync_request.js index cf84d9f3..aaa2878a 100644 --- a/libtextsecure/sync_request.js +++ b/libtextsecure/sync_request.js @@ -43,7 +43,11 @@ } }, onTimeout: function() { - this.dispatchEvent(new Event('timeout')); + if (this.contactSync || this.groupSync) { + this.dispatchEvent(new Event('success')); + } else { + this.dispatchEvent(new Event('timeout')); + } this.cleanup(); }, cleanup: function() {