mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 10:33:41 +02:00
Pass message ID to OpenKeychain
This commit is contained in:
@@ -3756,13 +3756,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
|
||||
private void onDecrypt(Intent intent) {
|
||||
if (pgpService.isBound()) {
|
||||
Intent data = new Intent();
|
||||
data.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
|
||||
|
||||
long id = intent.getLongExtra("id", -1);
|
||||
boolean auto = intent.getBooleanExtra("auto", false);
|
||||
|
||||
onDecrypt(data, id, auto);
|
||||
Intent data = new Intent();
|
||||
data.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
|
||||
data.putExtra(BuildConfig.APPLICATION_ID, id);
|
||||
|
||||
onDecrypt(data, auto);
|
||||
} else
|
||||
Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
@@ -3779,7 +3780,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
break;
|
||||
case REQUEST_DECRYPT:
|
||||
if (resultCode == RESULT_OK && data != null)
|
||||
onDecrypt(data, message, false);
|
||||
onDecrypt(data, false);
|
||||
break;
|
||||
case REQUEST_MESSAGE_DELETE:
|
||||
if (resultCode == RESULT_OK && data != null)
|
||||
@@ -3942,9 +3943,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
}.execute(this, args, "raw:save");
|
||||
}
|
||||
|
||||
private void onDecrypt(Intent data, long id, boolean auto) {
|
||||
private void onDecrypt(Intent data, boolean auto) {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
args.putParcelable("data", data);
|
||||
args.putBoolean("auto", auto);
|
||||
|
||||
@@ -3952,9 +3952,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
@Override
|
||||
protected PendingIntent onExecute(Context context, Bundle args) throws Throwable {
|
||||
// Get arguments
|
||||
long id = args.getLong("id");
|
||||
boolean auto = args.getBoolean("auto");
|
||||
Intent data = args.getParcelable("data");
|
||||
long id = data.getLongExtra(BuildConfig.APPLICATION_ID, -1);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityMessage message = db.message().getMessage(id);
|
||||
@@ -4019,6 +4019,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
|
||||
int resultCode = result.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR);
|
||||
Log.i("Result action=" + data.getAction() + " code=" + resultCode);
|
||||
Log.logExtras(data);
|
||||
switch (resultCode) {
|
||||
case OpenPgpApi.RESULT_CODE_SUCCESS:
|
||||
if (inline) {
|
||||
@@ -4092,7 +4093,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
|
||||
if (auto)
|
||||
return null;
|
||||
FragmentMessages.this.message = id;
|
||||
return result.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
|
||||
|
||||
case OpenPgpApi.RESULT_CODE_ERROR:
|
||||
|
||||
Reference in New Issue
Block a user