mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-12 04:25:08 -05:00
Simplify many, many boolean conditions with help from IntelliJ
This commit is contained in:
parent
3d27cf220a
commit
4f0bce1569
@ -81,7 +81,7 @@ public class ChooseIdentity extends K9ListActivity
|
|||||||
{
|
{
|
||||||
Identity identity = mAccount.getIdentity(position);
|
Identity identity = mAccount.getIdentity(position);
|
||||||
String email = identity.getEmail();
|
String email = identity.getEmail();
|
||||||
if (email != null && email.trim().equals("") == false)
|
if (email != null && !email.trim().equals(""))
|
||||||
{
|
{
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
|
|
||||||
|
@ -918,7 +918,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
text += "\n" + mQuotedText.getText().toString();
|
text += "\n" + mQuotedText.getText().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appendSig && mAccount.isSignatureBeforeQuotedText() == false)
|
if (appendSig && !mAccount.isSignatureBeforeQuotedText())
|
||||||
{
|
{
|
||||||
text = appendSignature(text);
|
text = appendSignature(text);
|
||||||
}
|
}
|
||||||
@ -1666,7 +1666,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
{
|
{
|
||||||
final String subject = prefix.matcher(message.getSubject()).replaceFirst("");
|
final String subject = prefix.matcher(message.getSubject()).replaceFirst("");
|
||||||
|
|
||||||
if (subject.toLowerCase().startsWith("re:") == false)
|
if (!subject.toLowerCase().startsWith("re:"))
|
||||||
{
|
{
|
||||||
mSubjectView.setText("Re: " + subject);
|
mSubjectView.setText("Re: " + subject);
|
||||||
}
|
}
|
||||||
|
@ -950,12 +950,12 @@ public class MessageList
|
|||||||
|
|
||||||
private void onMove(MessageInfoHolder holder)
|
private void onMove(MessageInfoHolder holder)
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == false)
|
if (!mController.isMoveCapable(holder.message.getFolder().getAccount()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mController.isMoveCapable(holder.message) == false)
|
if (!mController.isMoveCapable(holder.message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -974,12 +974,12 @@ public class MessageList
|
|||||||
|
|
||||||
private void onArchive(MessageInfoHolder holder)
|
private void onArchive(MessageInfoHolder holder)
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == false)
|
if (!mController.isMoveCapable(holder.message.getFolder().getAccount()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mController.isMoveCapable(holder.message) == false)
|
if (!mController.isMoveCapable(holder.message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -991,12 +991,12 @@ public class MessageList
|
|||||||
|
|
||||||
private void onSpam(MessageInfoHolder holder)
|
private void onSpam(MessageInfoHolder holder)
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == false)
|
if (!mController.isMoveCapable(holder.message.getFolder().getAccount()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mController.isMoveCapable(holder.message) == false)
|
if (!mController.isMoveCapable(holder.message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -1008,12 +1008,12 @@ public class MessageList
|
|||||||
|
|
||||||
private void onCopy(MessageInfoHolder holder)
|
private void onCopy(MessageInfoHolder holder)
|
||||||
{
|
{
|
||||||
if (mController.isCopyCapable(holder.message.getFolder().getAccount()) == false)
|
if (!mController.isCopyCapable(holder.message.getFolder().getAccount()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mController.isCopyCapable(holder.message) == false)
|
if (!mController.isCopyCapable(holder.message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -1092,7 +1092,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onMoveChosen(MessageInfoHolder holder, String folderName)
|
private void onMoveChosen(MessageInfoHolder holder, String folderName)
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == true && folderName != null)
|
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) && folderName != null)
|
||||||
{
|
{
|
||||||
if (K9.FOLDER_NONE.equalsIgnoreCase(folderName))
|
if (K9.FOLDER_NONE.equalsIgnoreCase(folderName))
|
||||||
{
|
{
|
||||||
@ -1105,7 +1105,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onCopyChosen(MessageInfoHolder holder, String folderName)
|
private void onCopyChosen(MessageInfoHolder holder, String folderName)
|
||||||
{
|
{
|
||||||
if (mController.isCopyCapable(holder.message.getFolder().getAccount()) == true && folderName != null)
|
if (mController.isCopyCapable(holder.message.getFolder().getAccount()) && folderName != null)
|
||||||
{
|
{
|
||||||
mController.copyMessage(holder.message.getFolder().getAccount(),
|
mController.copyMessage(holder.message.getFolder().getAccount(),
|
||||||
holder.message.getFolder().getName(), holder.message, folderName, null);
|
holder.message.getFolder().getName(), holder.message, folderName, null);
|
||||||
@ -1693,12 +1693,12 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
|
|
||||||
Account account = message.message.getFolder().getAccount();
|
Account account = message.message.getFolder().getAccount();
|
||||||
if (mController.isCopyCapable(account) == false)
|
if (!mController.isCopyCapable(account))
|
||||||
{
|
{
|
||||||
menu.findItem(R.id.copy).setVisible(false);
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mController.isMoveCapable(account) == false)
|
if (!mController.isMoveCapable(account))
|
||||||
{
|
{
|
||||||
menu.findItem(R.id.move).setVisible(false);
|
menu.findItem(R.id.move).setVisible(false);
|
||||||
menu.findItem(R.id.archive).setVisible(false);
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
@ -2255,12 +2255,12 @@ public class MessageList
|
|||||||
|
|
||||||
holder.flagged.setOnClickListener(flagClickListener);
|
holder.flagged.setOnClickListener(flagClickListener);
|
||||||
|
|
||||||
if (mStars == false)
|
if (!mStars)
|
||||||
{
|
{
|
||||||
holder.flagged.setVisibility(View.GONE);
|
holder.flagged.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCheckboxes == true)
|
if (mCheckboxes)
|
||||||
{
|
{
|
||||||
holder.selected.setVisibility(View.VISIBLE);
|
holder.selected.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@ -2440,7 +2440,7 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mCurrentFolder.lastCheckFailed == false)
|
if (!mCurrentFolder.lastCheckFailed)
|
||||||
{
|
{
|
||||||
holder.main.setText(String.format(getString(R.string.load_more_messages_fmt), mAccount.getDisplayCount()));
|
holder.main.setText(String.format(getString(R.string.load_more_messages_fmt), mAccount.getDisplayCount()));
|
||||||
}
|
}
|
||||||
@ -2513,7 +2513,7 @@ public class MessageList
|
|||||||
message.selected = isChecked;
|
message.selected = isChecked;
|
||||||
if (!mCheckboxes)
|
if (!mCheckboxes)
|
||||||
{
|
{
|
||||||
if (isChecked == true)
|
if (isChecked)
|
||||||
{
|
{
|
||||||
selected.setVisibility(View.VISIBLE);
|
selected.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@ -2779,7 +2779,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onMoveBatch()
|
private void onMoveBatch()
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(mAccount) == false)
|
if (!mController.isMoveCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2791,7 +2791,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isMoveCapable(message) == false)
|
if (!mController.isMoveCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this,
|
Toast toast = Toast.makeText(this,
|
||||||
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
@ -2812,7 +2812,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onMoveChosenBatch(String folderName)
|
private void onMoveChosenBatch(String folderName)
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(mAccount) == false)
|
if (!mController.isMoveCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2826,7 +2826,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isMoveCapable(message) == false)
|
if (!mController.isMoveCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this,
|
Toast toast = Toast.makeText(this,
|
||||||
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
@ -2847,7 +2847,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onArchiveBatch()
|
private void onArchiveBatch()
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(mAccount) == false)
|
if (!mController.isMoveCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2859,7 +2859,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isMoveCapable(message) == false)
|
if (!mController.isMoveCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -2879,7 +2879,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onSpamBatch()
|
private void onSpamBatch()
|
||||||
{
|
{
|
||||||
if (mController.isMoveCapable(mAccount) == false)
|
if (!mController.isMoveCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2891,7 +2891,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isMoveCapable(message) == false)
|
if (!mController.isMoveCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
@ -2911,7 +2911,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onCopyBatch()
|
private void onCopyBatch()
|
||||||
{
|
{
|
||||||
if (mController.isCopyCapable(mAccount) == false)
|
if (!mController.isCopyCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2923,7 +2923,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isCopyCapable(message) == false)
|
if (!mController.isCopyCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this,
|
Toast toast = Toast.makeText(this,
|
||||||
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
@ -2944,7 +2944,7 @@ public class MessageList
|
|||||||
|
|
||||||
private void onCopyChosenBatch(String folderName)
|
private void onCopyChosenBatch(String folderName)
|
||||||
{
|
{
|
||||||
if (mController.isCopyCapable(mAccount) == false)
|
if (!mController.isCopyCapable(mAccount))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2957,7 +2957,7 @@ public class MessageList
|
|||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
Message message = holder.message;
|
Message message = holder.message;
|
||||||
if (mController.isCopyCapable(message) == false)
|
if (!mController.isCopyCapable(message))
|
||||||
{
|
{
|
||||||
Toast toast = Toast.makeText(this,
|
Toast toast = Toast.makeText(this,
|
||||||
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
|
||||||
|
@ -203,7 +203,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
{
|
{
|
||||||
ret = onKeyDown(event.getKeyCode(), event);
|
ret = onKeyDown(event.getKeyCode(), event);
|
||||||
}
|
}
|
||||||
if (ret == false)
|
if (!ret)
|
||||||
{
|
{
|
||||||
ret = super.dispatchKeyEvent(event);
|
ret = super.dispatchKeyEvent(event);
|
||||||
}
|
}
|
||||||
@ -1859,11 +1859,11 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
getMenuInflater().inflate(R.menu.message_view_option, menu);
|
getMenuInflater().inflate(R.menu.message_view_option, menu);
|
||||||
optionsMenu = menu;
|
optionsMenu = menu;
|
||||||
prepareMenuItems();
|
prepareMenuItems();
|
||||||
if (MessagingController.getInstance(getApplication()).isCopyCapable(mAccount) == false)
|
if (!MessagingController.getInstance(getApplication()).isCopyCapable(mAccount))
|
||||||
{
|
{
|
||||||
menu.findItem(R.id.copy).setVisible(false);
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
}
|
}
|
||||||
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
|
if (!MessagingController.getInstance(getApplication()).isMoveCapable(mAccount))
|
||||||
{
|
{
|
||||||
menu.findItem(R.id.move).setVisible(false);
|
menu.findItem(R.id.move).setVisible(false);
|
||||||
menu.findItem(R.id.archive).setVisible(false);
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
@ -2220,7 +2220,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
// If the message contains external pictures and the "Show pictures"
|
// If the message contains external pictures and the "Show pictures"
|
||||||
// button wasn't already pressed, see if the user's preferences has us
|
// button wasn't already pressed, see if the user's preferences has us
|
||||||
// showing them anyway.
|
// showing them anyway.
|
||||||
if (hasExternalImages(text) && (mShowPictures == false))
|
if (hasExternalImages(text) && !mShowPictures)
|
||||||
{
|
{
|
||||||
if ((account.getShowPictures() == Account.ShowPictures.ALWAYS) ||
|
if ((account.getShowPictures() == Account.ShowPictures.ALWAYS) ||
|
||||||
((account.getShowPictures() == Account.ShowPictures.ONLY_FROM_CONTACTS) &&
|
((account.getShowPictures() == Account.ShowPictures.ONLY_FROM_CONTACTS) &&
|
||||||
@ -2558,7 +2558,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
mCryptoSignatureLayout.setVisibility(View.INVISIBLE);
|
mCryptoSignatureLayout.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!true || ((mMessage == null) && (mPgpData.getDecryptedData() == null)))
|
if (false || ((mMessage == null) && (mPgpData.getDecryptedData() == null)))
|
||||||
{
|
{
|
||||||
mDecryptLayout.setVisibility(View.GONE);
|
mDecryptLayout.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
|
@ -594,7 +594,7 @@ public class MessagingController implements Runnable
|
|||||||
public void messageFinished(Message message, int number, int ofTotal)
|
public void messageFinished(Message message, int number, int ofTotal)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (isMessageSuppressed(account, folder, message) == false)
|
if (!isMessageSuppressed(account, folder, message))
|
||||||
{
|
{
|
||||||
pendingMessages.add(message);
|
pendingMessages.add(message);
|
||||||
totalDone++;
|
totalDone++;
|
||||||
@ -717,17 +717,17 @@ public class MessagingController implements Runnable
|
|||||||
boolean noSpecialFolders = true;
|
boolean noSpecialFolders = true;
|
||||||
for (final Account account : accounts)
|
for (final Account account : accounts)
|
||||||
{
|
{
|
||||||
if (accountUuids != null && accountUuidsSet.contains(account.getUuid()) == false)
|
if (accountUuids != null && !accountUuidsSet.contains(account.getUuid()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accountUuids != null && accountUuidsSet.contains(account.getUuid()) == true)
|
if (accountUuids != null && accountUuidsSet.contains(account.getUuid()))
|
||||||
{
|
{
|
||||||
displayableOnly = true;
|
displayableOnly = true;
|
||||||
noSpecialFolders = true;
|
noSpecialFolders = true;
|
||||||
}
|
}
|
||||||
else if (integrate == false && folderNames == null)
|
else if (!integrate && folderNames == null)
|
||||||
{
|
{
|
||||||
Account.Searchable searchableFolders = account.getSearchableFolders();
|
Account.Searchable searchableFolders = account.getSearchableFolders();
|
||||||
switch (searchableFolders)
|
switch (searchableFolders)
|
||||||
@ -791,7 +791,7 @@ public class MessagingController implements Runnable
|
|||||||
{
|
{
|
||||||
if (folderNameSet != null)
|
if (folderNameSet != null)
|
||||||
{
|
{
|
||||||
if (folderNameSet.contains(localFolderName) == false)
|
if (!folderNameSet.contains(localFolderName))
|
||||||
|
|
||||||
{
|
{
|
||||||
include = false;
|
include = false;
|
||||||
@ -837,7 +837,7 @@ public class MessagingController implements Runnable
|
|||||||
public void messageStarted(String message, int number, int ofTotal) {}
|
public void messageStarted(String message, int number, int ofTotal) {}
|
||||||
public void messageFinished(Message message, int number, int ofTotal)
|
public void messageFinished(Message message, int number, int ofTotal)
|
||||||
{
|
{
|
||||||
if (isMessageSuppressed(message.getFolder().getAccount(), message.getFolder().getName(), message) == false)
|
if (!isMessageSuppressed(message.getFolder().getAccount(), message.getFolder().getName(), message))
|
||||||
{
|
{
|
||||||
List<Message> messages = new ArrayList<Message>();
|
List<Message> messages = new ArrayList<Message>();
|
||||||
|
|
||||||
@ -1125,7 +1125,7 @@ public class MessagingController implements Runnable
|
|||||||
l.synchronizeMailboxHeadersProgress(account, folder, headerProgress.get(), messageCount);
|
l.synchronizeMailboxHeadersProgress(account, folder, headerProgress.get(), messageCount);
|
||||||
}
|
}
|
||||||
Message localMessage = localUidMap.get(thisMess.getUid());
|
Message localMessage = localUidMap.get(thisMess.getUid());
|
||||||
if (localMessage == null || localMessage.olderThan(earliestDate) == false)
|
if (localMessage == null || !localMessage.olderThan(earliestDate))
|
||||||
{
|
{
|
||||||
remoteMessages.add(thisMess);
|
remoteMessages.add(thisMess);
|
||||||
remoteUidMap.put(thisMess.getUid(), thisMess);
|
remoteUidMap.put(thisMess.getUid(), thisMess);
|
||||||
@ -1303,7 +1303,7 @@ public class MessagingController implements Runnable
|
|||||||
Message[] messages = localFolder.getMessages(null, false);
|
Message[] messages = localFolder.getMessages(null, false);
|
||||||
for (Message message : messages)
|
for (Message message : messages)
|
||||||
{
|
{
|
||||||
if (message.isSet(Flag.SEEN) == false && message.isSet(Flag.DELETED) == false)
|
if (!message.isSet(Flag.SEEN) && !message.isSet(Flag.DELETED))
|
||||||
{
|
{
|
||||||
unreadCount++;
|
unreadCount++;
|
||||||
}
|
}
|
||||||
@ -1326,7 +1326,7 @@ public class MessagingController implements Runnable
|
|||||||
Message[] messages = localFolder.getMessages(null, false);
|
Message[] messages = localFolder.getMessages(null, false);
|
||||||
for (Message message : messages)
|
for (Message message : messages)
|
||||||
{
|
{
|
||||||
if (message.isSet(Flag.FLAGGED) == true && message.isSet(Flag.DELETED) == false)
|
if (message.isSet(Flag.FLAGGED) && !message.isSet(Flag.DELETED))
|
||||||
{
|
{
|
||||||
flaggedCount++;
|
flaggedCount++;
|
||||||
}
|
}
|
||||||
@ -1372,7 +1372,7 @@ public class MessagingController implements Runnable
|
|||||||
{
|
{
|
||||||
syncFlagMessages.add(message);
|
syncFlagMessages.add(message);
|
||||||
}
|
}
|
||||||
else if (isMessageSuppressed(account, folder, message) == false)
|
else if (!isMessageSuppressed(account, folder, message))
|
||||||
{
|
{
|
||||||
Message localMessage = localFolder.getMessage(message.getUid());
|
Message localMessage = localFolder.getMessage(message.getUid());
|
||||||
|
|
||||||
@ -1411,7 +1411,7 @@ public class MessagingController implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (localMessage.isSet(Flag.DELETED) == false)
|
else if (!localMessage.isSet(Flag.DELETED))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.v(K9.LOG_TAG, "Message with uid " + message.getUid() + " is present in the local store");
|
Log.v(K9.LOG_TAG, "Message with uid " + message.getUid() + " is present in the local store");
|
||||||
@ -1623,7 +1623,7 @@ public class MessagingController implements Runnable
|
|||||||
* (POP) may not be able to give us headers for
|
* (POP) may not be able to give us headers for
|
||||||
* ENVELOPE, only size.
|
* ENVELOPE, only size.
|
||||||
*/
|
*/
|
||||||
if (isMessageSuppressed(account, folder, message) == false)
|
if (!isMessageSuppressed(account, folder, message))
|
||||||
{
|
{
|
||||||
// Store the new message locally
|
// Store the new message locally
|
||||||
localFolder.appendMessages(new Message[]
|
localFolder.appendMessages(new Message[]
|
||||||
@ -1924,7 +1924,7 @@ public class MessagingController implements Runnable
|
|||||||
List<Message> undeletedMessages = new LinkedList<Message>();
|
List<Message> undeletedMessages = new LinkedList<Message>();
|
||||||
for (Message message : syncFlagMessages)
|
for (Message message : syncFlagMessages)
|
||||||
{
|
{
|
||||||
if (message.isSet(Flag.DELETED) == false)
|
if (!message.isSet(Flag.DELETED))
|
||||||
{
|
{
|
||||||
undeletedMessages.add(message);
|
undeletedMessages.add(message);
|
||||||
}
|
}
|
||||||
@ -2406,7 +2406,7 @@ public class MessagingController implements Runnable
|
|||||||
Log.d(K9.LOG_TAG, "processingPendingMoveOrCopy: source folder = " + srcFolder
|
Log.d(K9.LOG_TAG, "processingPendingMoveOrCopy: source folder = " + srcFolder
|
||||||
+ ", " + messages.size() + " messages, destination folder = " + destFolder + ", isCopy = " + isCopy);
|
+ ", " + messages.size() + " messages, destination folder = " + destFolder + ", isCopy = " + isCopy);
|
||||||
|
|
||||||
if (isCopy == false && destFolder.equals(account.getTrashFolderName()))
|
if (!isCopy && destFolder.equals(account.getTrashFolderName()))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "processingPendingMoveOrCopy doing special case for deleting message");
|
Log.d(K9.LOG_TAG, "processingPendingMoveOrCopy doing special case for deleting message");
|
||||||
@ -2431,7 +2431,7 @@ public class MessagingController implements Runnable
|
|||||||
remoteSrcFolder.moveMessages(messages.toArray(EMPTY_MESSAGE_ARRAY), remoteDestFolder);
|
remoteSrcFolder.moveMessages(messages.toArray(EMPTY_MESSAGE_ARRAY), remoteDestFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isCopy == false && Account.EXPUNGE_IMMEDIATELY.equals(account.getExpungePolicy()))
|
if (!isCopy && Account.EXPUNGE_IMMEDIATELY.equals(account.getExpungePolicy()))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "processingPendingMoveOrCopy expunging folder " + account.getDescription() + ":" + srcFolder);
|
Log.i(K9.LOG_TAG, "processingPendingMoveOrCopy expunging folder " + account.getDescription() + ":" + srcFolder);
|
||||||
@ -2698,7 +2698,7 @@ public class MessagingController implements Runnable
|
|||||||
Log.d(K9.LOG_TAG, "processPendingMoveOrCopyOld: source folder = " + srcFolder
|
Log.d(K9.LOG_TAG, "processPendingMoveOrCopyOld: source folder = " + srcFolder
|
||||||
+ ", uid = " + uid + ", destination folder = " + destFolder + ", isCopy = " + isCopy);
|
+ ", uid = " + uid + ", destination folder = " + destFolder + ", isCopy = " + isCopy);
|
||||||
|
|
||||||
if (isCopy == false && destFolder.equals(account.getTrashFolderName()))
|
if (!isCopy && destFolder.equals(account.getTrashFolderName()))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "processPendingMoveOrCopyOld doing special case for deleting message");
|
Log.d(K9.LOG_TAG, "processPendingMoveOrCopyOld doing special case for deleting message");
|
||||||
@ -2739,7 +2739,7 @@ public class MessagingController implements Runnable
|
|||||||
Message[] messages = localFolder.getMessages(null, false);
|
Message[] messages = localFolder.getMessages(null, false);
|
||||||
for (Message message : messages)
|
for (Message message : messages)
|
||||||
{
|
{
|
||||||
if (message.isSet(Flag.SEEN) == false)
|
if (!message.isSet(Flag.SEEN))
|
||||||
{
|
{
|
||||||
message.setFlag(Flag.SEEN, true);
|
message.setFlag(Flag.SEEN, true);
|
||||||
for (MessagingListener l : getListeners())
|
for (MessagingListener l : getListeners())
|
||||||
@ -2797,7 +2797,7 @@ public class MessagingController implements Runnable
|
|||||||
static AtomicBoolean loopCatch = new AtomicBoolean();
|
static AtomicBoolean loopCatch = new AtomicBoolean();
|
||||||
public void addErrorMessage(Account account, String subject, Throwable t)
|
public void addErrorMessage(Account account, String subject, Throwable t)
|
||||||
{
|
{
|
||||||
if (loopCatch.compareAndSet(false, true) == false)
|
if (!loopCatch.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2832,11 +2832,11 @@ public class MessagingController implements Runnable
|
|||||||
|
|
||||||
public void addErrorMessage(Account account, String subject, String body)
|
public void addErrorMessage(Account account, String subject, String body)
|
||||||
{
|
{
|
||||||
if (K9.ENABLE_ERROR_FOLDER == false)
|
if (!K9.ENABLE_ERROR_FOLDER)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (loopCatch.compareAndSet(false, true) == false)
|
if (!loopCatch.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2937,7 +2937,7 @@ public class MessagingController implements Runnable
|
|||||||
for (String uid : uids)
|
for (String uid : uids)
|
||||||
{
|
{
|
||||||
// Allows for re-allowing sending of messages that could not be sent
|
// Allows for re-allowing sending of messages that could not be sent
|
||||||
if (flag == Flag.FLAGGED && newState == false
|
if (flag == Flag.FLAGGED && !newState
|
||||||
&& uid != null
|
&& uid != null
|
||||||
&& account.getOutboxFolderName().equals(folderName))
|
&& account.getOutboxFolderName().equals(folderName))
|
||||||
{
|
{
|
||||||
@ -3513,7 +3513,7 @@ public class MessagingController implements Runnable
|
|||||||
if (e instanceof MessagingException)
|
if (e instanceof MessagingException)
|
||||||
{
|
{
|
||||||
MessagingException me = (MessagingException)e;
|
MessagingException me = (MessagingException)e;
|
||||||
if (me.isPermanentFailure() == false)
|
if (!me.isPermanentFailure())
|
||||||
{
|
{
|
||||||
// Decrement the counter if the message could not possibly have been sent
|
// Decrement the counter if the message could not possibly have been sent
|
||||||
int newVal = count.decrementAndGet();
|
int newVal = count.decrementAndGet();
|
||||||
@ -3754,11 +3754,11 @@ public class MessagingController implements Runnable
|
|||||||
{
|
{
|
||||||
Store localStore = account.getLocalStore();
|
Store localStore = account.getLocalStore();
|
||||||
Store remoteStore = account.getRemoteStore();
|
Store remoteStore = account.getRemoteStore();
|
||||||
if (isCopy == false && (remoteStore.isMoveCapable() == false || localStore.isMoveCapable() == false))
|
if (!isCopy && (!remoteStore.isMoveCapable() || !localStore.isMoveCapable()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isCopy == true && (remoteStore.isCopyCapable() == false || localStore.isCopyCapable() == false))
|
if (isCopy && (!remoteStore.isCopyCapable() || !localStore.isCopyCapable()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4195,7 +4195,7 @@ public class MessagingController implements Runnable
|
|||||||
for (final Account account : accounts)
|
for (final Account account : accounts)
|
||||||
{
|
{
|
||||||
final long accountInterval = account.getAutomaticCheckIntervalMinutes() * 60 * 1000;
|
final long accountInterval = account.getAutomaticCheckIntervalMinutes() * 60 * 1000;
|
||||||
if (ignoreLastCheckedTime == false && accountInterval <= 0)
|
if (!ignoreLastCheckedTime && accountInterval <= 0)
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Skipping synchronizing account " + account.getDescription());
|
Log.i(K9.LOG_TAG, "Skipping synchronizing account " + account.getDescription());
|
||||||
@ -4287,7 +4287,7 @@ public class MessagingController implements Runnable
|
|||||||
Log.v(K9.LOG_TAG, "Folder " + folder.getName() + " was last synced @ " +
|
Log.v(K9.LOG_TAG, "Folder " + folder.getName() + " was last synced @ " +
|
||||||
new Date(folder.getLastChecked()));
|
new Date(folder.getLastChecked()));
|
||||||
|
|
||||||
if (ignoreLastCheckedTime == false && folder.getLastChecked() >
|
if (!ignoreLastCheckedTime && folder.getLastChecked() >
|
||||||
(System.currentTimeMillis() - accountInterval))
|
(System.currentTimeMillis() - accountInterval))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
@ -4310,7 +4310,7 @@ public class MessagingController implements Runnable
|
|||||||
tLocalFolder = localStore.getFolder(folder.getName());
|
tLocalFolder = localStore.getFolder(folder.getName());
|
||||||
tLocalFolder.open(Folder.OpenMode.READ_WRITE);
|
tLocalFolder.open(Folder.OpenMode.READ_WRITE);
|
||||||
|
|
||||||
if (ignoreLastCheckedTime == false && tLocalFolder.getLastChecked() >
|
if (!ignoreLastCheckedTime && tLocalFolder.getLastChecked() >
|
||||||
(System.currentTimeMillis() - accountInterval))
|
(System.currentTimeMillis() - accountInterval))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
@ -4587,7 +4587,7 @@ public class MessagingController implements Runnable
|
|||||||
if (from != null)
|
if (from != null)
|
||||||
{
|
{
|
||||||
// Show From: address by default
|
// Show From: address by default
|
||||||
if (account.isAnIdentity(fromAddrs) == false)
|
if (!account.isAnIdentity(fromAddrs))
|
||||||
{
|
{
|
||||||
messageNotice.append(from + ": " + subject);
|
messageNotice.append(from + ": " + subject);
|
||||||
}
|
}
|
||||||
@ -4792,11 +4792,11 @@ public class MessagingController implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
public int compareTo(Command other)
|
public int compareTo(Command other)
|
||||||
{
|
{
|
||||||
if (other.isForeground == true && isForeground == false)
|
if (other.isForeground && !isForeground)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (other.isForeground == false && isForeground == true)
|
else if (!other.isForeground && isForeground)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4931,7 +4931,7 @@ public class MessagingController implements Runnable
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Store store = account.getRemoteStore();
|
Store store = account.getRemoteStore();
|
||||||
if (store.isPushCapable() == false)
|
if (!store.isPushCapable())
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Account " + account.getDescription() + " is not push capable, skipping");
|
Log.i(K9.LOG_TAG, "Account " + account.getDescription() + " is not push capable, skipping");
|
||||||
|
@ -45,7 +45,7 @@ public abstract class Message implements Part, Body
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o)
|
public boolean equals(Object o)
|
||||||
{
|
{
|
||||||
if (o == null || o instanceof Message == false)
|
if (o == null || !(o instanceof Message))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ public class ImapStore extends Store
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<? extends Folder> allFolders = listFolders(connection, false);
|
List<? extends Folder> allFolders = listFolders(connection, false);
|
||||||
if (forceListAll || mAccount.subscribedFoldersOnly() == false)
|
if (forceListAll || !mAccount.subscribedFoldersOnly())
|
||||||
{
|
{
|
||||||
return allFolders;
|
return allFolders;
|
||||||
}
|
}
|
||||||
@ -810,7 +810,7 @@ public class ImapStore extends Store
|
|||||||
@Override
|
@Override
|
||||||
public void copyMessages(Message[] messages, Folder folder) throws MessagingException
|
public void copyMessages(Message[] messages, Folder folder) throws MessagingException
|
||||||
{
|
{
|
||||||
if (folder instanceof ImapFolder == false)
|
if (!(folder instanceof ImapFolder))
|
||||||
{
|
{
|
||||||
throw new MessagingException("ImapFolder.copyMessages passed non-ImapFolder");
|
throw new MessagingException("ImapFolder.copyMessages passed non-ImapFolder");
|
||||||
}
|
}
|
||||||
@ -2188,7 +2188,7 @@ public class ImapStore extends Store
|
|||||||
nullResponses.add(nullResponse);
|
nullResponses.add(nullResponse);
|
||||||
receiveCapabilities(nullResponses);
|
receiveCapabilities(nullResponses);
|
||||||
|
|
||||||
if (hasCapability(CAPABILITY_CAPABILITY) == false)
|
if (!hasCapability(CAPABILITY_CAPABILITY))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Did not get capabilities in banner, requesting CAPABILITY for " + getLogId());
|
Log.i(K9.LOG_TAG, "Did not get capabilities in banner, requesting CAPABILITY for " + getLogId());
|
||||||
@ -2412,7 +2412,7 @@ public class ImapStore extends Store
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (authSuccess == false)
|
if (!authSuccess)
|
||||||
{
|
{
|
||||||
Log.e(K9.LOG_TAG, "Failed to login, closing connection for " + getLogId());
|
Log.e(K9.LOG_TAG, "Failed to login, closing connection for " + getLogId());
|
||||||
close();
|
close();
|
||||||
@ -2696,7 +2696,7 @@ public class ImapStore extends Store
|
|||||||
if (K9.DEBUG && K9.DEBUG_PROTOCOL_IMAP)
|
if (K9.DEBUG && K9.DEBUG_PROTOCOL_IMAP)
|
||||||
Log.v(K9.LOG_TAG, getLogId() + "<<<" + response);
|
Log.v(K9.LOG_TAG, getLogId() + "<<<" + response);
|
||||||
|
|
||||||
if (response.mTag != null && response.mTag.equalsIgnoreCase(tag) == false)
|
if (response.mTag != null && !response.mTag.equalsIgnoreCase(tag))
|
||||||
{
|
{
|
||||||
Log.w(K9.LOG_TAG, "After sending tag " + tag + ", got tag response from previous command " + response + " for " + getLogId());
|
Log.w(K9.LOG_TAG, "After sending tag " + tag + ", got tag response from previous command " + response + " for " + getLogId());
|
||||||
Iterator<ImapResponse> iter = responses.iterator();
|
Iterator<ImapResponse> iter = responses.iterator();
|
||||||
@ -2704,7 +2704,7 @@ public class ImapStore extends Store
|
|||||||
{
|
{
|
||||||
ImapResponse delResponse = iter.next();
|
ImapResponse delResponse = iter.next();
|
||||||
if (delResponse.mTag != null || delResponse.size() < 2
|
if (delResponse.mTag != null || delResponse.size() < 2
|
||||||
|| (ImapResponseParser.equalsIgnoreCase(delResponse.get(1), "EXISTS") == false && ImapResponseParser.equalsIgnoreCase(delResponse.get(1), "EXPUNGE") == false))
|
|| (!ImapResponseParser.equalsIgnoreCase(delResponse.get(1), "EXISTS") && !ImapResponseParser.equalsIgnoreCase(delResponse.get(1), "EXPUNGE")))
|
||||||
{
|
{
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
@ -2839,7 +2839,7 @@ public class ImapStore extends Store
|
|||||||
|
|
||||||
private void sendDone() throws IOException, MessagingException
|
private void sendDone() throws IOException, MessagingException
|
||||||
{
|
{
|
||||||
if (doneSent.compareAndSet(false, true) == true)
|
if (doneSent.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
ImapConnection conn = mConnection;
|
ImapConnection conn = mConnection;
|
||||||
if (conn != null)
|
if (conn != null)
|
||||||
@ -2871,7 +2871,7 @@ public class ImapStore extends Store
|
|||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Pusher starting for " + getLogId());
|
Log.i(K9.LOG_TAG, "Pusher starting for " + getLogId());
|
||||||
|
|
||||||
while (stop.get() != true)
|
while (!stop.get())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -2897,14 +2897,14 @@ public class ImapStore extends Store
|
|||||||
throw new MessagingException("Could not establish connection for IDLE");
|
throw new MessagingException("Could not establish connection for IDLE");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (conn.isIdleCapable() == false)
|
if (!conn.isIdleCapable())
|
||||||
{
|
{
|
||||||
stop.set(true);
|
stop.set(true);
|
||||||
receiver.pushError("IMAP server is not IDLE capable: " + conn.toString(), null);
|
receiver.pushError("IMAP server is not IDLE capable: " + conn.toString(), null);
|
||||||
throw new MessagingException("IMAP server is not IDLE capable:" + conn.toString());
|
throw new MessagingException("IMAP server is not IDLE capable:" + conn.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stop.get() != true && mAccount.isPushPollOnConnect() && (conn != oldConnection || needsPoll.getAndSet(false) == true))
|
if (!stop.get() && mAccount.isPushPollOnConnect() && (conn != oldConnection || needsPoll.getAndSet(false)))
|
||||||
{
|
{
|
||||||
List<ImapResponse> untaggedResponses = new ArrayList<ImapResponse>(storedUntaggedResponses);
|
List<ImapResponse> untaggedResponses = new ArrayList<ImapResponse>(storedUntaggedResponses);
|
||||||
storedUntaggedResponses.clear();
|
storedUntaggedResponses.clear();
|
||||||
@ -2915,7 +2915,7 @@ public class ImapStore extends Store
|
|||||||
}
|
}
|
||||||
receiver.syncFolder(ImapFolderPusher.this);
|
receiver.syncFolder(ImapFolderPusher.this);
|
||||||
}
|
}
|
||||||
if (stop.get() == true)
|
if (stop.get())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3010,7 +3010,7 @@ public class ImapStore extends Store
|
|||||||
{
|
{
|
||||||
Log.e(K9.LOG_TAG, "Got exception while closing for exception for " + getLogId(), me);
|
Log.e(K9.LOG_TAG, "Got exception while closing for exception for " + getLogId(), me);
|
||||||
}
|
}
|
||||||
if (stop.get() == true)
|
if (stop.get())
|
||||||
{
|
{
|
||||||
Log.i(K9.LOG_TAG, "Got exception while idling, but stop is set for " + getLogId());
|
Log.i(K9.LOG_TAG, "Got exception while idling, but stop is set for " + getLogId());
|
||||||
}
|
}
|
||||||
@ -3091,7 +3091,7 @@ public class ImapStore extends Store
|
|||||||
{
|
{
|
||||||
oldMessageCount += processUntaggedResponse(oldMessageCount, response, flagSyncMsgSeqs, removeMsgUids);
|
oldMessageCount += processUntaggedResponse(oldMessageCount, response, flagSyncMsgSeqs, removeMsgUids);
|
||||||
}
|
}
|
||||||
if (skipSync == false)
|
if (!skipSync)
|
||||||
{
|
{
|
||||||
if (oldMessageCount < 0)
|
if (oldMessageCount < 0)
|
||||||
{
|
{
|
||||||
@ -3242,7 +3242,7 @@ public class ImapStore extends Store
|
|||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
|
Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId());
|
||||||
|
|
||||||
if (flagSyncMsgSeqs.contains(msgSeq) == false)
|
if (!flagSyncMsgSeqs.contains(msgSeq))
|
||||||
{
|
{
|
||||||
flagSyncMsgSeqs.add(msgSeq);
|
flagSyncMsgSeqs.add(msgSeq);
|
||||||
}
|
}
|
||||||
@ -3366,7 +3366,7 @@ public class ImapStore extends Store
|
|||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.v(K9.LOG_TAG, "Got async response: " + response);
|
Log.v(K9.LOG_TAG, "Got async response: " + response);
|
||||||
|
|
||||||
if (stop.get() == true)
|
if (stop.get())
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "Got async untagged response: " + response + ", but stop is set for " + getLogId());
|
Log.d(K9.LOG_TAG, "Got async untagged response: " + response + ", but stop is set for " + getLogId());
|
||||||
@ -3391,7 +3391,7 @@ public class ImapStore extends Store
|
|||||||
if (ImapResponseParser.equalsIgnoreCase(responseType, "EXISTS") || ImapResponseParser.equalsIgnoreCase(responseType, "EXPUNGE") ||
|
if (ImapResponseParser.equalsIgnoreCase(responseType, "EXISTS") || ImapResponseParser.equalsIgnoreCase(responseType, "EXPUNGE") ||
|
||||||
ImapResponseParser.equalsIgnoreCase(responseType,"FETCH"))
|
ImapResponseParser.equalsIgnoreCase(responseType,"FETCH"))
|
||||||
{
|
{
|
||||||
if (started == false)
|
if (!started)
|
||||||
{
|
{
|
||||||
wakeLock.acquire(K9.PUSH_WAKE_LOCK_TIMEOUT);
|
wakeLock.acquire(K9.PUSH_WAKE_LOCK_TIMEOUT);
|
||||||
started = true;
|
started = true;
|
||||||
|
@ -695,7 +695,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
for (String queryField : queryFields)
|
for (String queryField : queryFields)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (anyAdded == true)
|
if (anyAdded)
|
||||||
{
|
{
|
||||||
whereClause.append(" OR ");
|
whereClause.append(" OR ");
|
||||||
}
|
}
|
||||||
@ -713,7 +713,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
boolean anyAdded = false;
|
boolean anyAdded = false;
|
||||||
for (LocalFolder folder : folders)
|
for (LocalFolder folder : folders)
|
||||||
{
|
{
|
||||||
if (anyAdded == true)
|
if (anyAdded)
|
||||||
{
|
{
|
||||||
whereClause.append(",");
|
whereClause.append(",");
|
||||||
}
|
}
|
||||||
@ -729,7 +729,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
boolean anyAdded = false;
|
boolean anyAdded = false;
|
||||||
for (Message message : messages)
|
for (Message message : messages)
|
||||||
{
|
{
|
||||||
if (anyAdded == true)
|
if (anyAdded)
|
||||||
{
|
{
|
||||||
whereClause.append(" OR ");
|
whereClause.append(" OR ");
|
||||||
}
|
}
|
||||||
@ -746,7 +746,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
boolean anyAdded = false;
|
boolean anyAdded = false;
|
||||||
for (Flag flag : forbiddenFlags)
|
for (Flag flag : forbiddenFlags)
|
||||||
{
|
{
|
||||||
if (anyAdded == true)
|
if (anyAdded)
|
||||||
{
|
{
|
||||||
whereClause.append(" AND ");
|
whereClause.append(" AND ");
|
||||||
}
|
}
|
||||||
@ -763,7 +763,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
boolean anyAdded = false;
|
boolean anyAdded = false;
|
||||||
for (Flag flag : requiredFlags)
|
for (Flag flag : requiredFlags)
|
||||||
{
|
{
|
||||||
if (anyAdded == true)
|
if (anyAdded)
|
||||||
{
|
{
|
||||||
whereClause.append(" OR ");
|
whereClause.append(" OR ");
|
||||||
}
|
}
|
||||||
@ -973,7 +973,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
if (cursor.moveToFirst())
|
if (cursor.moveToFirst())
|
||||||
{
|
{
|
||||||
int folderId = cursor.getInt(0);
|
int folderId = cursor.getInt(0);
|
||||||
return (folderId > 0) ? true : false;
|
return (folderId > 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1748,11 +1748,11 @@ public class LocalStore extends Store implements Serializable
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Message oldMessage = getMessage(uid);
|
Message oldMessage = getMessage(uid);
|
||||||
if (oldMessage != null && oldMessage.isSet(Flag.SEEN) == false)
|
if (oldMessage != null && !oldMessage.isSet(Flag.SEEN))
|
||||||
{
|
{
|
||||||
setUnreadMessageCount(getUnreadMessageCount() - 1);
|
setUnreadMessageCount(getUnreadMessageCount() - 1);
|
||||||
}
|
}
|
||||||
if (oldMessage != null && oldMessage.isSet(Flag.FLAGGED) == true)
|
if (oldMessage != null && oldMessage.isSet(Flag.FLAGGED))
|
||||||
{
|
{
|
||||||
setFlaggedMessageCount(getFlaggedMessageCount() - 1);
|
setFlaggedMessageCount(getFlaggedMessageCount() - 1);
|
||||||
}
|
}
|
||||||
@ -1831,11 +1831,11 @@ public class LocalStore extends Store implements Serializable
|
|||||||
saveAttachment(messageUid, attachment, copy);
|
saveAttachment(messageUid, attachment, copy);
|
||||||
}
|
}
|
||||||
saveHeaders(messageUid, (MimeMessage)message);
|
saveHeaders(messageUid, (MimeMessage)message);
|
||||||
if (message.isSet(Flag.SEEN) == false)
|
if (!message.isSet(Flag.SEEN))
|
||||||
{
|
{
|
||||||
setUnreadMessageCount(getUnreadMessageCount() + 1);
|
setUnreadMessageCount(getUnreadMessageCount() + 1);
|
||||||
}
|
}
|
||||||
if (message.isSet(Flag.FLAGGED) == true)
|
if (message.isSet(Flag.FLAGGED))
|
||||||
{
|
{
|
||||||
setFlaggedMessageCount(getFlaggedMessageCount() + 1);
|
setFlaggedMessageCount(getFlaggedMessageCount() + 1);
|
||||||
}
|
}
|
||||||
@ -2218,11 +2218,11 @@ public class LocalStore extends Store implements Serializable
|
|||||||
Message[] messages = getMessages(null);
|
Message[] messages = getMessages(null);
|
||||||
for (Message message : messages)
|
for (Message message : messages)
|
||||||
{
|
{
|
||||||
if (message.isSet(Flag.SEEN) == false)
|
if (!message.isSet(Flag.SEEN))
|
||||||
{
|
{
|
||||||
newUnread++;
|
newUnread++;
|
||||||
}
|
}
|
||||||
if (message.isSet(Flag.FLAGGED) == true)
|
if (message.isSet(Flag.FLAGGED))
|
||||||
{
|
{
|
||||||
newFlagged++;
|
newFlagged++;
|
||||||
}
|
}
|
||||||
@ -4607,7 +4607,7 @@ public class LocalStore extends Store implements Serializable
|
|||||||
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if ("X_BAD_FLAG".equals(flag) == false)
|
if (!"X_BAD_FLAG".equals(flag))
|
||||||
{
|
{
|
||||||
Log.w(K9.LOG_TAG, "Unable to parse flag " + flag);
|
Log.w(K9.LOG_TAG, "Unable to parse flag " + flag);
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ public class WebDavStore extends Store
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String path = mPath;
|
String path = mPath;
|
||||||
if (path.length() > 0 && path.startsWith("/") == false)
|
if (path.length() > 0 && !path.startsWith("/"))
|
||||||
{
|
{
|
||||||
path = "/" + mPath;
|
path = "/" + mPath;
|
||||||
}
|
}
|
||||||
@ -570,7 +570,7 @@ public class WebDavStore extends Store
|
|||||||
{
|
{
|
||||||
boolean status = false;
|
boolean status = false;
|
||||||
long currentTime = -1;
|
long currentTime = -1;
|
||||||
if (this.mAuthenticated == false)
|
if (!this.mAuthenticated)
|
||||||
{
|
{
|
||||||
status = true;
|
status = true;
|
||||||
}
|
}
|
||||||
@ -990,7 +990,7 @@ public class WebDavStore extends Store
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (tryAuth &&
|
if (tryAuth &&
|
||||||
mAuthenticated == false)
|
!mAuthenticated)
|
||||||
{
|
{
|
||||||
doFBA();
|
doFBA();
|
||||||
sendRequest(url, method, messageBody, headers, false);
|
sendRequest(url, method, messageBody, headers, false);
|
||||||
@ -1217,7 +1217,7 @@ public class WebDavStore extends Store
|
|||||||
encodedName = "Inbox";
|
encodedName = "Inbox";
|
||||||
}
|
}
|
||||||
this.mFolderUrl = WebDavStore.this.mUrl;
|
this.mFolderUrl = WebDavStore.this.mUrl;
|
||||||
if (WebDavStore.this.mUrl.endsWith("/") == false)
|
if (!WebDavStore.this.mUrl.endsWith("/"))
|
||||||
{
|
{
|
||||||
this.mFolderUrl += "/";
|
this.mFolderUrl += "/";
|
||||||
}
|
}
|
||||||
@ -1994,7 +1994,7 @@ public class WebDavStore extends Store
|
|||||||
bodyEntity.setContentType("message/rfc822");
|
bodyEntity.setContentType("message/rfc822");
|
||||||
|
|
||||||
String messageURL = mFolderUrl;
|
String messageURL = mFolderUrl;
|
||||||
if (messageURL.endsWith("/") == false)
|
if (!messageURL.endsWith("/"))
|
||||||
{
|
{
|
||||||
messageURL += "/";
|
messageURL += "/";
|
||||||
}
|
}
|
||||||
@ -2412,7 +2412,7 @@ public class WebDavStore extends Store
|
|||||||
if (readStatus != null &&
|
if (readStatus != null &&
|
||||||
!readStatus.equals(""))
|
!readStatus.equals(""))
|
||||||
{
|
{
|
||||||
Boolean value = readStatus.equals("0") ? false : true;
|
Boolean value = !readStatus.equals("0");
|
||||||
uidToRead.put(uid, value);
|
uidToRead.put(uid, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2494,7 +2494,7 @@ public class WebDavStore extends Store
|
|||||||
if (header.equals("read"))
|
if (header.equals("read"))
|
||||||
{
|
{
|
||||||
String read = data.get(header);
|
String read = data.get(header);
|
||||||
Boolean readStatus = read.equals("0") ? false : true;
|
Boolean readStatus = !read.equals("0");
|
||||||
|
|
||||||
envelope.setReadStatus(readStatus);
|
envelope.setReadStatus(readStatus);
|
||||||
}
|
}
|
||||||
|
@ -247,15 +247,15 @@ public class SmtpTransport extends Transport
|
|||||||
boolean authCramMD5Supported = false;
|
boolean authCramMD5Supported = false;
|
||||||
for (String result : results)
|
for (String result : results)
|
||||||
{
|
{
|
||||||
if (result.matches(".*AUTH.*LOGIN.*$") == true)
|
if (result.matches(".*AUTH.*LOGIN.*$"))
|
||||||
{
|
{
|
||||||
authLoginSupported = true;
|
authLoginSupported = true;
|
||||||
}
|
}
|
||||||
if (result.matches(".*AUTH.*PLAIN.*$") == true)
|
if (result.matches(".*AUTH.*PLAIN.*$"))
|
||||||
{
|
{
|
||||||
authPlainSupported = true;
|
authPlainSupported = true;
|
||||||
}
|
}
|
||||||
if (result.matches(".*AUTH.*CRAM-MD5.*$") == true && mAuthType != null && mAuthType.equals("CRAM_MD5"))
|
if (result.matches(".*AUTH.*CRAM-MD5.*$") && mAuthType != null && mAuthType.equals("CRAM_MD5"))
|
||||||
{
|
{
|
||||||
authCramMD5Supported = true;
|
authCramMD5Supported = true;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ public class Editor implements android.content.SharedPreferences.Editor
|
|||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
String newValue = entry.getValue();
|
String newValue = entry.getValue();
|
||||||
String oldValue = snapshot.get(key);
|
String oldValue = snapshot.get(key);
|
||||||
if (removeAll || removals.contains(key) || newValue.equals(oldValue) != true)
|
if (removeAll || removals.contains(key) || !newValue.equals(oldValue))
|
||||||
{
|
{
|
||||||
storage.put(key, newValue);
|
storage.put(key, newValue);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ public class Storage implements SharedPreferences
|
|||||||
private void keyChange(String key)
|
private void keyChange(String key)
|
||||||
{
|
{
|
||||||
ArrayList<String> changedKeys = workingChangedKeys.get();
|
ArrayList<String> changedKeys = workingChangedKeys.get();
|
||||||
if (changedKeys.contains(key) == false)
|
if (!changedKeys.contains(key))
|
||||||
{
|
{
|
||||||
changedKeys.add(key);
|
changedKeys.add(key);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ public class MailService extends CoreService
|
|||||||
if (true) return;
|
if (true) return;
|
||||||
NotificationManager notifMgr =
|
NotificationManager notifMgr =
|
||||||
(NotificationManager)getApplication().getSystemService(Context.NOTIFICATION_SERVICE);
|
(NotificationManager)getApplication().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (hasConnectivity == false)
|
if (!hasConnectivity)
|
||||||
{
|
{
|
||||||
String notice = getApplication().getString(R.string.no_connection_alert);
|
String notice = getApplication().getString(R.string.no_connection_alert);
|
||||||
String header = getApplication().getString(R.string.alert_header);
|
String header = getApplication().getString(R.string.alert_header);
|
||||||
@ -343,7 +343,7 @@ public class MailService extends CoreService
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
long delay = (shortestInterval * (60 * 1000));
|
long delay = (shortestInterval * (60 * 1000));
|
||||||
long base = (previousInterval == -1 || lastCheckEnd == -1 || considerLastCheckEnd == false ? System.currentTimeMillis() : lastCheckEnd);
|
long base = (previousInterval == -1 || lastCheckEnd == -1 || !considerLastCheckEnd ? System.currentTimeMillis() : lastCheckEnd);
|
||||||
long nextTime = base + delay;
|
long nextTime = base + delay;
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG,
|
Log.i(K9.LOG_TAG,
|
||||||
|
@ -49,7 +49,7 @@ public class SleepService extends CoreService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
boolean countedDown = latch.await(sleepTime, TimeUnit.MILLISECONDS);
|
boolean countedDown = latch.await(sleepTime, TimeUnit.MILLISECONDS);
|
||||||
if (countedDown == false)
|
if (!countedDown)
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "SleepService latch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
|
Log.d(K9.LOG_TAG, "SleepService latch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
|
||||||
@ -66,7 +66,7 @@ public class SleepService extends CoreService
|
|||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "SleepService waiting for reacquireLatch for id = " + id + ", thread " + Thread.currentThread().getName());
|
Log.d(K9.LOG_TAG, "SleepService waiting for reacquireLatch for id = " + id + ", thread " + Thread.currentThread().getName());
|
||||||
if (sleepDatum.reacquireLatch.await(5000, TimeUnit.MILLISECONDS) == false)
|
if (!sleepDatum.reacquireLatch.await(5000, TimeUnit.MILLISECONDS))
|
||||||
{
|
{
|
||||||
Log.w(K9.LOG_TAG, "SleepService reacquireLatch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
|
Log.w(K9.LOG_TAG, "SleepService reacquireLatch timed out for id = " + id + ", thread " + Thread.currentThread().getName());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user