mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-01 04:37:44 +00:00
ea0945d406
// FREEBIE
40 lines
1.4 KiB
Java
40 lines
1.4 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.documents.IdentityKeyMismatch;
|
|
import org.whispersystems.libsignal.IdentityKey;
|
|
|
|
public class VerifySpan extends ClickableSpan {
|
|
|
|
private final Context context;
|
|
private final long recipientId;
|
|
private final IdentityKey identityKey;
|
|
|
|
public VerifySpan(@NonNull Context context, @NonNull IdentityKeyMismatch mismatch) {
|
|
this.context = context;
|
|
this.recipientId = mismatch.getRecipientId();
|
|
this.identityKey = mismatch.getIdentityKey();
|
|
}
|
|
|
|
public VerifySpan(@NonNull Context context, long recipientId, @NonNull IdentityKey identityKey) {
|
|
this.context = context;
|
|
this.recipientId = recipientId;
|
|
this.identityKey = identityKey;
|
|
}
|
|
|
|
@Override
|
|
public void onClick(View widget) {
|
|
Intent intent = new Intent(context, VerifyIdentityActivity.class);
|
|
intent.putExtra(VerifyIdentityActivity.RECIPIENT_ID, recipientId);
|
|
intent.putExtra(VerifyIdentityActivity.RECIPIENT_IDENTITY, new IdentityKeyParcelable(identityKey));
|
|
context.startActivity(intent);
|
|
}
|
|
}
|