deliver the user id as well for secret key selection, so k9mail can use it to display the signature key

This commit is contained in:
Thialfihar
2010-06-01 14:59:06 +00:00
parent 4229b94270
commit 5547f61e4f
4 changed files with 54 additions and 13 deletions

View File

@@ -346,7 +346,7 @@ public class EncryptActivity extends BaseActivity {
if (mMessage.getText().length() > 0 &&
((mEncryptionKeyIds != null &&
mEncryptionKeyIds.length > 0) ||
getSecretKeyId() > 0)) {
getSecretKeyId() != 0)) {
encryptClicked();
}
}
@@ -467,7 +467,7 @@ public class EncryptActivity extends BaseActivity {
return;
}
} else {
boolean encryptIt = mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0;
boolean encryptIt = (mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0);
// for now require at least one form of encryption for files
if (!encryptIt && mEncryptTarget == Id.target.file) {
Toast.makeText(this, R.string.selectEncryptionKey, Toast.LENGTH_SHORT).show();
@@ -537,7 +537,7 @@ public class EncryptActivity extends BaseActivity {
} else {
encryptionKeyIds = mEncryptionKeyIds;
signatureKeyId = getSecretKeyId();
signOnly = mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0;
signOnly = (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0);
}
if (mEncryptTarget == Id.target.file) {
@@ -558,7 +558,9 @@ public class EncryptActivity extends BaseActivity {
} else {
String message = mMessage.getText().toString();
if (signOnly) {
if (signOnly &&
!(mIntent != null &&
mIntent.getAction().equals(Apg.Intent.ENCRYPT_AND_RETURN))) {
// fix the message a bit, trailing spaces and newlines break stuff,
// because GMail sends as HTML and such things fuck up the signature,
// TODO: things like "<" and ">" also fuck up the signature