mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-14 07:08:00 -05:00
Issue 530
This commit is contained in:
parent
65d7f2180a
commit
d50a16c6b4
@ -894,16 +894,16 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
private void onIdentityChosen(Intent intent)
|
private void onIdentityChosen(Intent intent)
|
||||||
{
|
{
|
||||||
Bundle bundle = intent.getExtras();;
|
Bundle bundle = intent.getExtras();;
|
||||||
mIdentity = (Account.Identity)bundle.getSerializable(ChooseIdentity.EXTRA_IDENTITY);
|
switchToIdentity( (Account.Identity)bundle.getSerializable(ChooseIdentity.EXTRA_IDENTITY));
|
||||||
// if (mIdentityChanged == false)
|
}
|
||||||
// {
|
|
||||||
// Toast.makeText(this, getString(R.string.identity_will_not_be_saved),
|
private void switchToIdentity(Account.Identity identity)
|
||||||
// Toast.LENGTH_LONG).show();
|
{
|
||||||
// }
|
mIdentity = identity;
|
||||||
mIdentityChanged = true;
|
mIdentityChanged = true;
|
||||||
mDraftNeedsSaving = true;
|
mDraftNeedsSaving = true;
|
||||||
updateFrom();
|
updateFrom();
|
||||||
updateSignature();
|
updateSignature();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFrom()
|
private void updateFrom()
|
||||||
@ -1062,17 +1062,52 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
mQuotedText.setVisibility(View.VISIBLE);
|
mQuotedText.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ACTION_REPLY_ALL.equals(action) || ACTION_REPLY.equals(action))
|
||||||
|
{
|
||||||
|
Account.Identity useIdentity = null;
|
||||||
|
for (Address address : message.getRecipients(RecipientType.TO)) {
|
||||||
|
Account.Identity identity = mAccount.findIdentity(address);
|
||||||
|
if (identity != null) {
|
||||||
|
useIdentity = identity;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (useIdentity == null)
|
||||||
|
{
|
||||||
|
if (message.getRecipients(RecipientType.CC).length > 0) {
|
||||||
|
for (Address address : message.getRecipients(RecipientType.CC)) {
|
||||||
|
Account.Identity identity = mAccount.findIdentity(address);
|
||||||
|
if (identity != null) {
|
||||||
|
useIdentity = identity;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (useIdentity != null)
|
||||||
|
{
|
||||||
|
Account.Identity defaultIdentity = mAccount.getIdentity(0);
|
||||||
|
if (useIdentity != defaultIdentity)
|
||||||
|
{
|
||||||
|
switchToIdentity(useIdentity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ACTION_REPLY_ALL.equals(action)) {
|
if (ACTION_REPLY_ALL.equals(action)) {
|
||||||
for (Address address : message.getRecipients(RecipientType.TO)) {
|
for (Address address : message.getRecipients(RecipientType.TO)) {
|
||||||
|
Account.Identity identity = mAccount.findIdentity(address);
|
||||||
if (!mAccount.isAnIdentity(address)) {
|
if (!mAccount.isAnIdentity(address)) {
|
||||||
addAddress(mToView, address);
|
addAddress(mToView, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (message.getRecipients(RecipientType.CC).length > 0) {
|
if (message.getRecipients(RecipientType.CC).length > 0) {
|
||||||
for (Address address : message.getRecipients(RecipientType.CC)) {
|
for (Address address : message.getRecipients(RecipientType.CC)) {
|
||||||
if (!Utility.arrayContains(replyToAddresses, address)) {
|
if (!mAccount.isAnIdentity(address) && !Utility.arrayContains(replyToAddresses, address)) {
|
||||||
addAddress(mCcView, address);
|
addAddress(mCcView, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
mCcView.setVisibility(View.VISIBLE);
|
mCcView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user