mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-24 07:58:50 -05:00
some small bugfixes
This commit is contained in:
parent
9ad474e95b
commit
2f04e7ee05
@ -188,7 +188,7 @@ public class DecryptActivity extends BaseActivity {
|
||||
mMessage.setText(data);
|
||||
}
|
||||
mSubject = extras.getString(Intent.EXTRA_SUBJECT);
|
||||
if (mSubject.startsWith("Fwd: ")) {
|
||||
if (mSubject != null && mSubject.startsWith("Fwd: ")) {
|
||||
mSubject = mSubject.substring(5);
|
||||
}
|
||||
} else if (Apg.Intent.DECRYPT.equals(mIntent.getAction())) {
|
||||
@ -247,8 +247,6 @@ public class DecryptActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
mReplyTo = extras.getString(Apg.EXTRA_REPLY_TO);
|
||||
mSubject = extras.getString(Apg.EXTRA_SUBJECT);
|
||||
mReturnResult = true;
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,8 @@ public class EncryptActivity extends BaseActivity {
|
||||
mEncryptButton.setText(R.string.btn_encrypt);
|
||||
}
|
||||
|
||||
if (mMessage.getText().length() > 0 &&
|
||||
if (mReturnResult &&
|
||||
mMessage.getText().length() > 0 &&
|
||||
((mEncryptionKeyIds != null &&
|
||||
mEncryptionKeyIds.length > 0) ||
|
||||
getSecretKeyId() != 0)) {
|
||||
@ -760,9 +761,9 @@ public class EncryptActivity extends BaseActivity {
|
||||
getString(R.string.errorMessage, error), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String message = Strings.fromUTF8ByteArray(data.getByteArray(Apg.EXTRA_ENCRYPTED_MESSAGE));
|
||||
switch (mEncryptTarget) {
|
||||
case Id.target.clipboard: {
|
||||
String message = new String(data.getByteArray(Apg.EXTRA_ENCRYPTED_MESSAGE));
|
||||
ClipboardManager clip = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clip.setText(message);
|
||||
Toast.makeText(this, R.string.encryptionToClipboardSuccessful,
|
||||
@ -779,6 +780,7 @@ public class EncryptActivity extends BaseActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = new String(data.getByteArray(Apg.EXTRA_ENCRYPTED_MESSAGE));
|
||||
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
emailIntent.setType("text/plain; charset=utf-8");
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
|
||||
|
Loading…
Reference in New Issue
Block a user