Simplify logic in ActivityListener.getActionInProgressOperation()
@@ -83,13 +83,14 @@ public class ActivityListener extends SimpleMessagingListener {
} else {
displayName = loadingFolderName;
}
- if (account != null && account.getInboxFolderName() != null &&
- account.getInboxFolderName().equalsIgnoreCase(displayName)) {
+
+ if (account != null) {
+ if (displayName.equalsIgnoreCase(account.getInboxFolderName())) {
displayName = context.getString(R.string.special_mailbox_name_inbox);
- } else if (account != null && account.getOutboxFolderName() != null &&
- account.getOutboxFolderName().equals(displayName)) {
+ } else if (displayName.equalsIgnoreCase(account.getOutboxFolderName())) {
displayName = context.getString(R.string.special_mailbox_name_outbox);
}
+ }
if (loadingHeaderFolderName != null) {
return context.getString(R.string.status_loading_account_folder_headers,
