Merge branch 'dev' into group-leaving

This commit is contained in:
Niels Andriesse
2020-02-21 11:22:24 +07:00
4 changed files with 13 additions and 15 deletions

View File

@@ -128,7 +128,7 @@ fun sendDeviceLinkMessage(context: Context, hexEncodedPublicKey: String, deviceL
}
Promise.ofSuccess(Unit)
} catch (e: Exception) {
Log.d("Loki", "Failed to send device link message to $hexEncodedPublicKey: $e")
Log.d("Loki", "Failed to send device link message to: $hexEncodedPublicKey due to error: $e.")
Promise.ofFail(e)
}
}

View File

@@ -22,7 +22,6 @@ import org.thoughtcrime.securesms.loki.redesign.dialogs.*
import org.thoughtcrime.securesms.loki.signAndSendDeviceLinkMessage
import org.thoughtcrime.securesms.sms.MessageSender
import org.thoughtcrime.securesms.util.TextSecurePreferences
import org.thoughtcrime.securesms.util.Util
import org.whispersystems.signalservice.loki.api.DeviceLink
import org.whispersystems.signalservice.loki.api.LokiFileServerAPI
import java.util.*
@@ -153,12 +152,11 @@ class LinkedDevicesActivity : PassphraseRequiredActionBarActivity, LoaderManager
MessageSender.syncAllGroups(this@LinkedDevicesActivity)
MessageSender.syncAllContacts(this@LinkedDevicesActivity, Address.fromSerialized(deviceLink.slaveHexEncodedPublicKey))
}
}.failUi {
Toast.makeText(this, "Couldn't link device", Toast.LENGTH_LONG).show()
}.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 {
DatabaseFactory.getLokiPreKeyBundleDatabase(this).removePreKeyBundle(deviceLink.slaveHexEncodedPublicKey)

View File

@@ -55,7 +55,7 @@ class LokiPreKeyBundleDatabase(context: Context, helper: SQLCipherOpenHelper) :
failureCount += 1
}
}
Log.w("Loki", "Failed to generate a valid PreKeyBundle for $hexEncodedPublicKey")
Log.w("Loki", "Failed to generate a valid pre key bundle for: $hexEncodedPublicKey.")
return null
}