Refactor MessageReceiver for storage/server independence
Let the libtextsecure consumer pass in their own server url, username, password, and signaling key, as with libtextsecure-java. Also brings reconnect logic up into the MessageReceiver class, which is the only place it should apply.
This commit is contained in:
parent
e59a5792d5
commit
a925027cd2
3 changed files with 91 additions and 47 deletions
|
@ -65,7 +65,13 @@
|
|||
if (!textsecure.registration.isDone()) { return; }
|
||||
|
||||
// initialize the socket and start listening for messages
|
||||
messageReceiver = new textsecure.MessageReceiver('wss://textsecure-service-staging.whispersystems.org', window);
|
||||
messageReceiver = new textsecure.MessageReceiver(
|
||||
'https://textsecure-service-staging.whispersystems.org',
|
||||
textsecure.storage.get('number_id'),
|
||||
textsecure.storage.get('password'),
|
||||
textsecure.storage.get('signaling_key'),
|
||||
window
|
||||
);
|
||||
}
|
||||
|
||||
function onContactReceived(ev) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue