This commit is contained in:
Niels Andriesse 2020-02-13 16:05:40 +11:00
parent b9dd42beb1
commit bcc219bd1f
2 changed files with 3 additions and 3 deletions

View File

@ -1773,7 +1773,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
*/
private Recipient getMasterRecipient(String hexEncodedPublicKey) {
try {
String masterHexEncodedPublicKey = LokiDeviceLinkUtilities.INSTANCE.getMasterHexEncodedPublicKey(hexEncodedPublicKey).get();
String masterHexEncodedPublicKey = PromiseUtil.timeout(LokiDeviceLinkUtilities.INSTANCE.getMasterHexEncodedPublicKey(hexEncodedPublicKey), 5000).get();
String targetHexEncodedPublicKey = (masterHexEncodedPublicKey != null) ? masterHexEncodedPublicKey : hexEncodedPublicKey;
// If the public key matches our master device then we need to forward the message to ourselves (note to self)
String ourMasterHexEncodedPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(context);

View File

@ -153,14 +153,14 @@ class LinkedDevicesActivity : PassphraseRequiredActionBarActivity, LoaderManager
Timer().schedule(4000) {
MessageSender.syncAllContacts(this@LinkedDevicesActivity, Address.fromSerialized(deviceLink.slaveHexEncodedPublicKey))
}
}.fail { exception ->
}.fail {
LokiFileServerAPI.shared.removeDeviceLink(deviceLink) // If this fails we have a problem
DatabaseFactory.getLokiPreKeyBundleDatabase(this).removePreKeyBundle(deviceLink.slaveHexEncodedPublicKey)
Util.runOnMain {
Toast.makeText(this, "Couldn't link device", Toast.LENGTH_LONG).show()
}
}
}.failUi { exception ->
}.failUi {
DatabaseFactory.getLokiPreKeyBundleDatabase(this).removePreKeyBundle(deviceLink.slaveHexEncodedPublicKey)
Toast.makeText(this, "Couldn't link device", Toast.LENGTH_LONG).show()
}