Fix crash & undo debugging setup

This commit is contained in:
Niels Andriesse 2019-06-11 09:46:42 +10:00
parent c8cc22e8fe
commit c47be74f0d
3 changed files with 10 additions and 6 deletions

View File

@ -19,6 +19,7 @@ package org.thoughtcrime.securesms;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Toast;
import org.thoughtcrime.securesms.conversation.ConversationActivity;
import org.thoughtcrime.securesms.database.Address;
@ -49,10 +50,10 @@ public class NewConversationActivity extends ContactSelectionActivity {
public void onContactSelected(String number) {
boolean isValid = PublicKeyValidation.isValid(number);
// if (!isValid) {
// Toast.makeText(this, R.string.activity_new_conversation_invalid_public_key_message, Toast.LENGTH_SHORT).show();
// return;
// }
if (!isValid) {
Toast.makeText(this, R.string.activity_new_conversation_invalid_public_key_message, Toast.LENGTH_SHORT).show();
return;
}
Recipient recipient = Recipient.from(this, Address.fromSerialized(number), true);

View File

@ -197,7 +197,7 @@ public class DatabaseFactory {
this.searchDatabase = new SearchDatabase(context, databaseHelper);
this.jobDatabase = new JobDatabase(context, databaseHelper);
this.lokiAPIDatabase = new LokiAPIDatabase(TextSecurePreferences.getLocalNumber(context), context, databaseHelper);
this.lokiAPIDatabase = new LokiAPIDatabase(context, databaseHelper);
this.lokiContactPreKeyDatabase = new LokiContactPreKeyDatabase(context, databaseHelper);
this.lokiPreKeyBundleDatabase = new LokiPreKeyBundleDatabase(context, databaseHelper);
}

View File

@ -4,10 +4,13 @@ import android.content.ContentValues
import android.content.Context
import org.thoughtcrime.securesms.database.Database
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper
import org.thoughtcrime.securesms.util.TextSecurePreferences
import org.whispersystems.signalservice.loki.api.LokiAPIDatabaseProtocol
import org.whispersystems.signalservice.loki.api.LokiAPITarget
class LokiAPIDatabase(private val userPublicKey: String, context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), LokiAPIDatabaseProtocol {
class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), LokiAPIDatabaseProtocol {
private val userPublicKey get() = TextSecurePreferences.getLocalNumber(context)
companion object {
// Swarm cache