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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user