mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-11 05:38:03 -05:00
Use new account extra to allow multiple accounts
This commit is contained in:
parent
8f1723a451
commit
974a73b07d
@ -2003,7 +2003,12 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
||||
|
||||
private void executeOpenPgpMethod(Intent intent) {
|
||||
intent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
|
||||
|
||||
// this follows user id format of OpenPGP to allow key generation based on it
|
||||
// includes account number to make it unique
|
||||
String accName = mAccount.getName() + " (" + mAccount.getAccountNumber() + ") <"
|
||||
+ mAccount.getEmail() + ">";
|
||||
intent.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, accName);
|
||||
|
||||
final InputStream is = getOpenPgpInputStream();
|
||||
final ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
|
||||
|
@ -28,6 +28,7 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fsck.k9.Account;
|
||||
import com.fsck.k9.K9;
|
||||
import com.fsck.k9.R;
|
||||
import com.fsck.k9.crypto.CryptoHelper;
|
||||
@ -60,6 +61,7 @@ public class MessageOpenPgpView extends LinearLayout {
|
||||
private static final int REQUEST_CODE_DECRYPT_VERIFY = 12;
|
||||
|
||||
String mData;
|
||||
Account mAccount;
|
||||
|
||||
public MessageOpenPgpView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@ -90,12 +92,13 @@ public class MessageOpenPgpView extends LinearLayout {
|
||||
* Fill the decrypt layout with signature data, if known, make controls
|
||||
* visible, if they should be visible.
|
||||
*/
|
||||
public void updateLayout(String openPgpProvider, String decryptedData,
|
||||
public void updateLayout(Account account, String decryptedData,
|
||||
final OpenPgpSignatureResult signatureResult,
|
||||
final Message message) {
|
||||
|
||||
// set class variables
|
||||
mOpenPgpProvider = openPgpProvider;
|
||||
mAccount = account;
|
||||
mOpenPgpProvider = mAccount.getOpenPgpProvider();
|
||||
mDecryptedData = decryptedData;
|
||||
mMessage = message;
|
||||
|
||||
@ -263,6 +266,11 @@ public class MessageOpenPgpView extends LinearLayout {
|
||||
private void decryptVerify(Intent intent) {
|
||||
intent.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
|
||||
intent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
|
||||
// this follows user id format of OpenPGP to allow key generation based on it
|
||||
// includes account number to make it unique
|
||||
String accName = mAccount.getName() + " (" + mAccount.getAccountNumber() + ") <"
|
||||
+ mAccount.getEmail() + ">";
|
||||
intent.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, accName);
|
||||
|
||||
InputStream is = null;
|
||||
try {
|
||||
|
@ -620,7 +620,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
if (text != null) {
|
||||
loadBodyFromText(text);
|
||||
updateCryptoLayout(account.getCryptoProvider(), pgpData, message);
|
||||
mOpenPgpView.updateLayout(account.getOpenPgpProvider(),pgpData.getDecryptedData(),
|
||||
mOpenPgpView.updateLayout(account, pgpData.getDecryptedData(),
|
||||
pgpData.getSignatureResult(), message);
|
||||
} else {
|
||||
showStatusMessage(getContext().getString(R.string.webview_empty_message));
|
||||
|
Loading…
Reference in New Issue
Block a user