mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
lift some gpg code into the crypto initializer
This commit is contained in:
parent
3ffa28fa02
commit
8116a0f39f
@ -1034,8 +1034,8 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
{
|
{
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
setLoadPictures(savedInstanceState.getBoolean(SHOW_PICTURES));
|
setLoadPictures(savedInstanceState.getBoolean(SHOW_PICTURES));
|
||||||
mPgpData = (PgpData) savedInstanceState.getSerializable(STATE_PGP_DATA);
|
initializeCrypto((PgpData) savedInstanceState.getSerializable(STATE_PGP_DATA)
|
||||||
initializeCrypto();
|
);
|
||||||
updateDecryptLayout();
|
updateDecryptLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,8 +1054,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
mAttachments.removeAllViews();
|
mAttachments.removeAllViews();
|
||||||
findSurroundingMessagesUid();
|
findSurroundingMessagesUid();
|
||||||
// start with fresh, empty PGP data
|
// start with fresh, empty PGP data
|
||||||
mPgpData = null;
|
initializeCrypto(null);
|
||||||
initializeCrypto();
|
|
||||||
mTopView.setVisibility(View.VISIBLE);
|
mTopView.setVisibility(View.VISIBLE);
|
||||||
MessagingController.getInstance(getApplication()).loadMessageForView(
|
MessagingController.getInstance(getApplication()).loadMessageForView(
|
||||||
mAccount,
|
mAccount,
|
||||||
@ -2264,21 +2263,23 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
mConnection.disconnect();
|
mConnection.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeCrypto()
|
private void initializeCrypto(PgpData data)
|
||||||
{
|
{
|
||||||
if (mPgpData != null)
|
if (data == null)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mAccount == null)
|
if (mAccount == null)
|
||||||
{
|
{
|
||||||
mAccount = Preferences.getPreferences(this).getAccount(mMessageReference.accountUuid);
|
mAccount = Preferences.getPreferences(this).getAccount(mMessageReference.accountUuid);
|
||||||
}
|
}
|
||||||
mPgpData = new PgpData();
|
mPgpData = new PgpData();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mPgpData = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the decrypt layout with signature data, if known, make controls visible, if
|
* Fill the decrypt layout with signature data, if known, make controls visible, if
|
||||||
|
Loading…
Reference in New Issue
Block a user