more otr cleanup
This commit is contained in:
parent
c7fd54a17e
commit
d55a3842d3
|
@ -2,7 +2,6 @@ package eu.siacs.conversations.ui;
|
||||||
|
|
||||||
import android.databinding.DataBindingUtil;
|
import android.databinding.DataBindingUtil;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
@ -20,11 +19,9 @@ import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
import android.widget.ImageButton;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.wefika.flowlayout.FlowLayout;
|
|
||||||
|
|
||||||
import org.openintents.openpgp.util.OpenPgpUtils;
|
import org.openintents.openpgp.util.OpenPgpUtils;
|
||||||
|
|
||||||
|
@ -41,7 +38,6 @@ import eu.siacs.conversations.entities.Contact;
|
||||||
import eu.siacs.conversations.entities.ListItem;
|
import eu.siacs.conversations.entities.ListItem;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService.OnAccountUpdate;
|
import eu.siacs.conversations.services.XmppConnectionService.OnAccountUpdate;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
|
import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
|
||||||
import eu.siacs.conversations.utils.CryptoHelper;
|
|
||||||
import eu.siacs.conversations.utils.UIHelper;
|
import eu.siacs.conversations.utils.UIHelper;
|
||||||
import eu.siacs.conversations.utils.XmppUri;
|
import eu.siacs.conversations.utils.XmppUri;
|
||||||
import eu.siacs.conversations.xml.Namespace;
|
import eu.siacs.conversations.xml.Namespace;
|
||||||
|
@ -449,13 +445,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
||||||
keyType.setTextColor(ContextCompat.getColor(this, R.color.accent));
|
keyType.setTextColor(ContextCompat.getColor(this, R.color.accent));
|
||||||
}
|
}
|
||||||
key.setText(OpenPgpUtils.convertKeyIdToHex(contact.getPgpKeyId()));
|
key.setText(OpenPgpUtils.convertKeyIdToHex(contact.getPgpKeyId()));
|
||||||
final OnClickListener openKey = new OnClickListener() {
|
final OnClickListener openKey = v -> launchOpenKeyChain(contact.getPgpKeyId());
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
launchOpenKeyChain(contact.getPgpKeyId());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
view.setOnClickListener(openKey);
|
view.setOnClickListener(openKey);
|
||||||
key.setOnClickListener(openKey);
|
key.setOnClickListener(openKey);
|
||||||
keyType.setOnClickListener(openKey);
|
keyType.setOnClickListener(openKey);
|
||||||
|
@ -478,26 +468,6 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void confirmToDeleteFingerprint(final String fingerprint) {
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
||||||
builder.setTitle(R.string.delete_fingerprint);
|
|
||||||
builder.setMessage(R.string.sure_delete_fingerprint);
|
|
||||||
builder.setNegativeButton(R.string.cancel, null);
|
|
||||||
builder.setPositiveButton(R.string.delete,
|
|
||||||
new android.content.DialogInterface.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
if (contact.deleteOtrFingerprint(fingerprint)) {
|
|
||||||
populateView();
|
|
||||||
xmppConnectionService.syncRosterToDisk(contact.getAccount());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
builder.create().show();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onBackendConnected() {
|
public void onBackendConnected() {
|
||||||
if (accountJid != null && contactJid != null) {
|
if (accountJid != null && contactJid != null) {
|
||||||
Account account = xmppConnectionService.findAccountByJid(accountJid);
|
Account account = xmppConnectionService.findAccountByJid(accountJid);
|
||||||
|
|
|
@ -456,7 +456,8 @@ public class ConversationActivity extends XmppActivity
|
||||||
pgp.setVisible(Config.supportOpenPgp());
|
pgp.setVisible(Config.supportOpenPgp());
|
||||||
none.setVisible(Config.supportUnencrypted() || conversation.getMode() == Conversation.MODE_MULTI);
|
none.setVisible(Config.supportUnencrypted() || conversation.getMode() == Conversation.MODE_MULTI);
|
||||||
axolotl.setVisible(Config.supportOmemo());
|
axolotl.setVisible(Config.supportOmemo());
|
||||||
if (!conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) {
|
final AxolotlService axolotlService = conversation.getAccount().getAxolotlService();
|
||||||
|
if (axolotlService == null || !axolotlService.isConversationAxolotlCapable(conversation)) {
|
||||||
axolotl.setEnabled(false);
|
axolotl.setEnabled(false);
|
||||||
}
|
}
|
||||||
switch (conversation.getNextEncryption()) {
|
switch (conversation.getNextEncryption()) {
|
||||||
|
|
Loading…
Reference in a new issue