From 4f46c6317b4f4f55503f8b46c9a7056be36d2219 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Mon, 7 Oct 2019 13:28:53 +1100 Subject: [PATCH] Renaming. --- .../thoughtcrime/securesms/jobs/PushDecryptJob.java | 10 +++++----- .../thoughtcrime/securesms/loki/DeviceLinkingDialog.kt | 6 +++--- .../thoughtcrime/securesms/loki/DeviceLinkingView.kt | 2 +- src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt | 6 +++--- src/org/thoughtcrime/securesms/loki/SeedActivity.kt | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index 0fa54252fe..8d50bee3a4 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -1026,10 +1026,10 @@ public class PushDecryptJob extends BaseJob implements InjectableType { } else if (isRequest && isSecondaryDevice) { Log.w("Loki", "Received a pairing request while being a secondary device. Ignored."); return false; - } else if (isRequest && !authorisation.getPrimaryDevicePubKey().equals(ourPubKey)) { + } else if (isRequest && !authorisation.getPrimaryDevicePublicKey().equals(ourPubKey)) { Log.w("Loki", "Received a pairing request addressed to another pubkey. Ignored."); return false; - } else if (isRequest && authorisation.getSecondaryDevicePubKey().equals(ourPubKey)) { + } else if (isRequest && authorisation.getSecondaryDevicePublicKey().equals(ourPubKey)) { Log.w("Loki", "Received a pairing request from ourselves. Ignored."); return false; } @@ -1041,7 +1041,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType { String ourNumber = TextSecurePreferences.getLocalNumber(context); if (authorisation.getType() == LokiPairingAuthorisation.Type.REQUEST) { handlePairingRequest(authorisation, envelope); - } else if (authorisation.getSecondaryDevicePubKey().equals(ourNumber)) { + } else if (authorisation.getSecondaryDevicePublicKey().equals(ourNumber)) { // If we were listed as a secondary device, it means we got a confirmation back from the primary device handlePairingAuthorisationForSelf(authorisation, envelope, content); } @@ -1076,7 +1076,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType { // Unimplemented for REQUEST if (authorisation.getType() != LokiPairingAuthorisation.Type.GRANT) { return; } - Log.d("Loki", "Receiving pairing authorisation from: " + authorisation.getPrimaryDevicePubKey()); + Log.d("Loki", "Receiving pairing authorisation from: " + authorisation.getPrimaryDevicePublicKey()); // Send out accept event LokiDeviceLinkingSession.Companion.getShared().acceptedLinkingRequest(authorisation); @@ -1088,7 +1088,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType { TextSecurePreferences.setIsSecondaryDevice(context, true); // Send a background message to the primary device - sendBackgroundMessage(authorisation.getPrimaryDevicePubKey()); + sendBackgroundMessage(authorisation.getPrimaryDevicePublicKey()); // Propagate the updates to the file server LokiStorageAPI storageAPI = LokiStorageAPI.Companion.getShared(); diff --git a/src/org/thoughtcrime/securesms/loki/DeviceLinkingDialog.kt b/src/org/thoughtcrime/securesms/loki/DeviceLinkingDialog.kt index e9062dd14d..250d3ad4d1 100644 --- a/src/org/thoughtcrime/securesms/loki/DeviceLinkingDialog.kt +++ b/src/org/thoughtcrime/securesms/loki/DeviceLinkingDialog.kt @@ -62,9 +62,9 @@ class DeviceLinkingDialog private constructor(private val context: Context, priv // Send authorisation message retryIfNeeded(3) { - sendAuthorisationMessage(context, pairing.secondaryDevicePubKey, signedAuthorisation) + sendAuthorisationMessage(context, pairing.secondaryDevicePublicKey, signedAuthorisation) }.fail { - Log.e("Loki", "Failed to send GRANT authorisation to ${pairing.secondaryDevicePubKey}") + Log.e("Loki", "Failed to send GRANT authorisation to ${pairing.secondaryDevicePublicKey}") } // Add the auth to the database @@ -85,7 +85,7 @@ class DeviceLinkingDialog private constructor(private val context: Context, priv if (mode == DeviceLinkingView.Mode.Master && view.pairingAuthorisation != null) { val authorisation = view.pairingAuthorisation!! // Remove pre key bundle from the requesting device - DatabaseFactory.getLokiPreKeyBundleDatabase(context).removePreKeyBundle(authorisation.secondaryDevicePubKey) + DatabaseFactory.getLokiPreKeyBundleDatabase(context).removePreKeyBundle(authorisation.secondaryDevicePublicKey) } delegate?.handleDeviceLinkingDialogDismissed() diff --git a/src/org/thoughtcrime/securesms/loki/DeviceLinkingView.kt b/src/org/thoughtcrime/securesms/loki/DeviceLinkingView.kt index 8973fde268..758d12cc86 100644 --- a/src/org/thoughtcrime/securesms/loki/DeviceLinkingView.kt +++ b/src/org/thoughtcrime/securesms/loki/DeviceLinkingView.kt @@ -115,7 +115,7 @@ class DeviceLinkingView private constructor(context: Context, attrs: AttributeSe titleTextView.text = resources.getString(R.string.view_device_linking_title_3) explanationTextView.text = resources.getString(R.string.view_device_linking_explanation_2) mnemonicTextView.visibility = View.VISIBLE - val hexEncodedPublicKey = authorisation.secondaryDevicePubKey.removing05PrefixIfNeeded() + val hexEncodedPublicKey = authorisation.secondaryDevicePublicKey.removing05PrefixIfNeeded() mnemonicTextView.text = MnemonicCodec(languageFileDirectory).encode(hexEncodedPublicKey).split(" ").slice(0 until 3).joinToString(" ") authorizeButton.visibility = View.VISIBLE diff --git a/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt b/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt index d7aa8a18b0..756596f7dc 100644 --- a/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt @@ -166,11 +166,11 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( override fun insertOrUpdatePairingAuthorisation(authorisation: LokiPairingAuthorisation) { val database = databaseHelper.writableDatabase val values = ContentValues() - values.put(primaryDevice, authorisation.primaryDevicePubKey) - values.put(secondaryDevice, authorisation.secondaryDevicePubKey) + values.put(primaryDevice, authorisation.primaryDevicePublicKey) + values.put(secondaryDevice, authorisation.secondaryDevicePublicKey) if (authorisation.requestSignature != null) { values.put(requestSignature, Base64.encodeBytes(authorisation.requestSignature)) } if (authorisation.grantSignature != null) { values.put(grantSignature, Base64.encodeBytes(authorisation.grantSignature)) } - database.insertOrUpdate(multiDeviceAuthTable, values, "$primaryDevice = ? AND $secondaryDevice = ?", arrayOf(authorisation.primaryDevicePubKey, authorisation.secondaryDevicePubKey)) + database.insertOrUpdate(multiDeviceAuthTable, values, "$primaryDevice = ? AND $secondaryDevice = ?", arrayOf(authorisation.primaryDevicePublicKey, authorisation.secondaryDevicePublicKey)) } override fun removePairingAuthorisations(pubKey: String) { diff --git a/src/org/thoughtcrime/securesms/loki/SeedActivity.kt b/src/org/thoughtcrime/securesms/loki/SeedActivity.kt index 02cab64c3f..204d1c5d80 100644 --- a/src/org/thoughtcrime/securesms/loki/SeedActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/SeedActivity.kt @@ -233,7 +233,7 @@ class SeedActivity : BaseActionBarActivity() { // Send the request to the other user CoroutineScope(Dispatchers.Main).launch { retryIfNeeded(3) { - sendAuthorisationMessage(this@SeedActivity, authorisation.primaryDevicePubKey, authorisation).get() + sendAuthorisationMessage(this@SeedActivity, authorisation.primaryDevicePublicKey, authorisation).get() }.failUi { dialog.dismiss() resetRegistration()