mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-21 23:32:51 +00:00
Added long click signature info
This commit is contained in:
parent
f77a4058ea
commit
b0be9f3e19
2 changed files with 15 additions and 6 deletions
|
@ -1105,6 +1105,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
ibAmp.setOnClickListener(this);
|
ibAmp.setOnClickListener(this);
|
||||||
ibDecrypt.setOnClickListener(this);
|
ibDecrypt.setOnClickListener(this);
|
||||||
ibVerify.setOnClickListener(this);
|
ibVerify.setOnClickListener(this);
|
||||||
|
ibVerify.setOnLongClickListener(this);
|
||||||
ibUndo.setOnClickListener(this);
|
ibUndo.setOnClickListener(this);
|
||||||
ibAnswer.setOnClickListener(this);
|
ibAnswer.setOnClickListener(this);
|
||||||
ibRule.setOnClickListener(this);
|
ibRule.setOnClickListener(this);
|
||||||
|
@ -1230,6 +1231,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
ibAmp.setOnClickListener(null);
|
ibAmp.setOnClickListener(null);
|
||||||
ibDecrypt.setOnClickListener(null);
|
ibDecrypt.setOnClickListener(null);
|
||||||
ibVerify.setOnClickListener(null);
|
ibVerify.setOnClickListener(null);
|
||||||
|
ibVerify.setOnLongClickListener(null);
|
||||||
ibUndo.setOnClickListener(null);
|
ibUndo.setOnClickListener(null);
|
||||||
ibAnswer.setOnClickListener(null);
|
ibAnswer.setOnClickListener(null);
|
||||||
ibRule.setOnClickListener(null);
|
ibRule.setOnClickListener(null);
|
||||||
|
@ -3574,12 +3576,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
(EntityMessage.PGP_SIGNENCRYPT.equals(message.encrypt) ||
|
(EntityMessage.PGP_SIGNENCRYPT.equals(message.encrypt) ||
|
||||||
EntityMessage.SMIME_SIGNENCRYPT.equals(message.encrypt))) {
|
EntityMessage.SMIME_SIGNENCRYPT.equals(message.encrypt))) {
|
||||||
properties.setValue("auto_decrypted", message.id, true);
|
properties.setValue("auto_decrypted", message.id, true);
|
||||||
onActionVerifyDecrypt(message, true);
|
onActionVerifyDecrypt(message, true, false);
|
||||||
} else if (auto_verify && !auto_verified && !message.verified &&
|
} else if (auto_verify && !auto_verified && !message.verified &&
|
||||||
(EntityMessage.PGP_SIGNONLY.equals(message.encrypt) ||
|
(EntityMessage.PGP_SIGNONLY.equals(message.encrypt) ||
|
||||||
EntityMessage.SMIME_SIGNONLY.equals(message.encrypt))) {
|
EntityMessage.SMIME_SIGNONLY.equals(message.encrypt))) {
|
||||||
properties.setValue("auto_verified", message.id, true);
|
properties.setValue("auto_verified", message.id, true);
|
||||||
onActionVerifyDecrypt(message, true);
|
onActionVerifyDecrypt(message, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4598,9 +4600,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
properties.setExpanded(message, false, false);
|
properties.setExpanded(message, false, false);
|
||||||
properties.setHeight(message.id, null);
|
properties.setHeight(message.id, null);
|
||||||
} else
|
} else
|
||||||
onActionVerifyDecrypt(message, false);
|
onActionVerifyDecrypt(message, false, false);
|
||||||
} else if (id == R.id.ibVerify) {
|
} else if (id == R.id.ibVerify) {
|
||||||
onActionVerifyDecrypt(message, false);
|
onActionVerifyDecrypt(message, false, false);
|
||||||
} else if (id == R.id.ibUndo) {
|
} else if (id == R.id.ibUndo) {
|
||||||
ActivityCompose.undoSend(message.id, context, owner, parentFragment.getParentFragmentManager());
|
ActivityCompose.undoSend(message.id, context, owner, parentFragment.getParentFragmentManager());
|
||||||
} else if (id == R.id.ibAnswer) {
|
} else if (id == R.id.ibAnswer) {
|
||||||
|
@ -4896,6 +4898,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
|
|
||||||
popupMenu.show();
|
popupMenu.show();
|
||||||
return true;
|
return true;
|
||||||
|
} else if (id == R.id.ibVerify) {
|
||||||
|
onActionVerifyDecrypt(message, false, true);
|
||||||
|
return true;
|
||||||
} else if (id == R.id.ibMove) {
|
} else if (id == R.id.ibMove) {
|
||||||
if (message.folderReadOnly)
|
if (message.folderReadOnly)
|
||||||
return false;
|
return false;
|
||||||
|
@ -6112,7 +6117,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onActionVerifyDecrypt(TupleMessageEx message, boolean auto) {
|
private void onActionVerifyDecrypt(TupleMessageEx message, boolean auto, boolean info) {
|
||||||
boolean inline = properties.getValue("inline_encrypted", message.id);
|
boolean inline = properties.getValue("inline_encrypted", message.id);
|
||||||
int encrypt = (message.encrypt == null || inline ? EntityMessage.PGP_SIGNENCRYPT /* Inline */ : message.encrypt);
|
int encrypt = (message.encrypt == null || inline ? EntityMessage.PGP_SIGNENCRYPT /* Inline */ : message.encrypt);
|
||||||
|
|
||||||
|
@ -6121,6 +6126,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
new Intent(FragmentMessages.ACTION_VERIFYDECRYPT)
|
new Intent(FragmentMessages.ACTION_VERIFYDECRYPT)
|
||||||
.putExtra("id", message.id)
|
.putExtra("id", message.id)
|
||||||
.putExtra("auto", auto)
|
.putExtra("auto", auto)
|
||||||
|
.putExtra("info", info)
|
||||||
.putExtra("type", encrypt));
|
.putExtra("type", encrypt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9323,12 +9323,14 @@ public class FragmentMessages extends FragmentBase
|
||||||
private void onVerifyDecrypt(Intent intent) {
|
private void onVerifyDecrypt(Intent intent) {
|
||||||
long id = intent.getLongExtra("id", -1);
|
long id = intent.getLongExtra("id", -1);
|
||||||
boolean auto = intent.getBooleanExtra("auto", false);
|
boolean auto = intent.getBooleanExtra("auto", false);
|
||||||
|
boolean info = intent.getBooleanExtra("info", false);
|
||||||
int type = intent.getIntExtra("type", EntityMessage.ENCRYPT_NONE);
|
int type = intent.getIntExtra("type", EntityMessage.ENCRYPT_NONE);
|
||||||
|
|
||||||
final Bundle args = new Bundle();
|
final Bundle args = new Bundle();
|
||||||
args.putLong("id", id);
|
args.putLong("id", id);
|
||||||
args.putInt("type", type);
|
args.putInt("type", type);
|
||||||
args.putBoolean("auto", auto);
|
args.putBoolean("auto", auto);
|
||||||
|
args.putBoolean("info", info);
|
||||||
|
|
||||||
if (EntityMessage.SMIME_SIGNONLY.equals(type))
|
if (EntityMessage.SMIME_SIGNONLY.equals(type))
|
||||||
onSmime(args);
|
onSmime(args);
|
||||||
|
@ -10398,6 +10400,7 @@ public class FragmentMessages extends FragmentBase
|
||||||
} else
|
} else
|
||||||
try {
|
try {
|
||||||
boolean auto = args.getBoolean("auto");
|
boolean auto = args.getBoolean("auto");
|
||||||
|
boolean info = args.getBoolean("info");
|
||||||
String sender = args.getString("sender");
|
String sender = args.getString("sender");
|
||||||
Date time = (Date) args.getSerializable("time");
|
Date time = (Date) args.getSerializable("time");
|
||||||
boolean known = args.getBoolean("known");
|
boolean known = args.getBoolean("known");
|
||||||
|
@ -10418,7 +10421,7 @@ public class FragmentMessages extends FragmentBase
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (known && !record.isExpired(time) && match && valid)
|
if (!info && known && !record.isExpired(time) && match && valid)
|
||||||
Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG))
|
Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG))
|
||||||
.show();
|
.show();
|
||||||
else if (!auto) {
|
else if (!auto) {
|
||||||
|
|
Loading…
Reference in a new issue