mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 10:47:46 +00:00
737810475e
This was a holdover from Signal's origins as a pure SMS app. It causes problems, depends on undefined device specific behavior, and should no longer be necessary now that we have all the information we need to E164 all numbers. // FREEBIE
42 lines
1.5 KiB
Java
42 lines
1.5 KiB
Java
package org.thoughtcrime.securesms.util;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.support.annotation.NonNull;
|
|
import android.text.style.ClickableSpan;
|
|
import android.view.View;
|
|
|
|
import org.thoughtcrime.securesms.VerifyIdentityActivity;
|
|
import org.thoughtcrime.securesms.crypto.IdentityKeyParcelable;
|
|
import org.thoughtcrime.securesms.database.Address;
|
|
import org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch;
|
|
import org.whispersystems.libsignal.IdentityKey;
|
|
|
|
public class VerifySpan extends ClickableSpan {
|
|
|
|
private final Context context;
|
|
private final Address address;
|
|
private final IdentityKey identityKey;
|
|
|
|
public VerifySpan(@NonNull Context context, @NonNull IdentityKeyMismatch mismatch) {
|
|
this.context = context;
|
|
this.address = mismatch.getAddress();
|
|
this.identityKey = mismatch.getIdentityKey();
|
|
}
|
|
|
|
public VerifySpan(@NonNull Context context, @NonNull Address address, @NonNull IdentityKey identityKey) {
|
|
this.context = context;
|
|
this.address = address;
|
|
this.identityKey = identityKey;
|
|
}
|
|
|
|
@Override
|
|
public void onClick(View widget) {
|
|
Intent intent = new Intent(context, VerifyIdentityActivity.class);
|
|
intent.putExtra(VerifyIdentityActivity.ADDRESS_EXTRA, address);
|
|
intent.putExtra(VerifyIdentityActivity.IDENTITY_EXTRA, new IdentityKeyParcelable(identityKey));
|
|
intent.putExtra(VerifyIdentityActivity.VERIFIED_EXTRA, false);
|
|
context.startActivity(intent);
|
|
}
|
|
}
|