Add SyncRequest class

Similar in function to an xhr request, a textsecure.SyncRequest object
is initialized from a message sender and receiver pair and initiates a
request for sync from the master device. It later fires a success event
when both contacts and groups are done syncing, or a timeout event after
one minute.

// FREEBIE
This commit is contained in:
lilia 2016-01-14 13:40:26 -08:00
parent d8381cfc47
commit 925c1bdb33
5 changed files with 246 additions and 11 deletions

View file

@ -38,10 +38,8 @@
var launch = function() {
bg.openInbox();
bg.removeEventListener('textsecure:contactsync', launch);
clearTimeout(timeout);
window.close();
};
var timeout = setTimeout(launch, 60000);
bg.addEventListener('textsecure:contactsync', launch);
view.showSync();
}).catch(function(e) {