Search in sources :

Example 1 with UntrustedSendDialog

use of org.thoughtcrime.securesms.components.identity.UntrustedSendDialog in project Signal-Android by signalapp.

the class ConversationActivity method handleUntrustedRecipients.

private void handleUntrustedRecipients() {
    List<Recipient> untrustedRecipients = identityRecords.getUntrustedRecipients(this);
    List<IdentityRecord> untrustedRecords = identityRecords.getUntrustedRecords();
    String untrustedMessage = IdentityUtil.getUntrustedSendDialogDescription(this, untrustedRecipients);
    if (untrustedMessage == null)
        return;
    // noinspection CodeBlock2Expr
    new UntrustedSendDialog(this, untrustedMessage, untrustedRecords, () -> {
        initializeIdentityRecords().addListener(new ListenableFuture.Listener<Boolean>() {

            @Override
            public void onSuccess(Boolean result) {
                sendMessage();
            }

            @Override
            public void onFailure(ExecutionException e) {
                throw new AssertionError(e);
            }
        });
    }).show();
}
Also used : AttachmentDrawerListener(org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.AttachmentDrawerListener) OnFocusChangeListener(android.view.View.OnFocusChangeListener) AssertedSuccessListener(org.thoughtcrime.securesms.util.concurrent.AssertedSuccessListener) OnKeyboardShownListener(org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout.OnKeyboardShownListener) OnKeyListener(android.view.View.OnKeyListener) RecipientModifiedListener(org.thoughtcrime.securesms.recipients.RecipientModifiedListener) OnClickListener(android.view.View.OnClickListener) IdentityRecord(org.thoughtcrime.securesms.database.IdentityDatabase.IdentityRecord) Recipient(org.thoughtcrime.securesms.recipients.Recipient) ByteString(com.google.protobuf.ByteString) ExecutionException(java.util.concurrent.ExecutionException) UntrustedSendDialog(org.thoughtcrime.securesms.components.identity.UntrustedSendDialog)

Aggregations

OnClickListener (android.view.View.OnClickListener)1 OnFocusChangeListener (android.view.View.OnFocusChangeListener)1 OnKeyListener (android.view.View.OnKeyListener)1 ByteString (com.google.protobuf.ByteString)1 ExecutionException (java.util.concurrent.ExecutionException)1 OnKeyboardShownListener (org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout.OnKeyboardShownListener)1 AttachmentDrawerListener (org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.AttachmentDrawerListener)1 UntrustedSendDialog (org.thoughtcrime.securesms.components.identity.UntrustedSendDialog)1 IdentityRecord (org.thoughtcrime.securesms.database.IdentityDatabase.IdentityRecord)1 Recipient (org.thoughtcrime.securesms.recipients.Recipient)1 RecipientModifiedListener (org.thoughtcrime.securesms.recipients.RecipientModifiedListener)1 AssertedSuccessListener (org.thoughtcrime.securesms.util.concurrent.AssertedSuccessListener)1