Prevent crash

This commit is contained in:
M66B 2019-05-07 17:52:14 +02:00
parent 05fb3a51d0
commit 75774daa20
3 changed files with 7 additions and 8 deletions

View File

@ -938,7 +938,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
bnvActions.getMenu().findItem(R.id.action_delete).setVisible(debug ||
(inTrash && message.msgid != null) ||
(!inTrash && hasTrash && message.uid != null) ||
(inOutbox && (!TextUtils.isEmpty(message.error) || !message.identitySynchronize)));
(inOutbox && !TextUtils.isEmpty(message.error)));
bnvActions.getMenu().findItem(R.id.action_delete).setTitle(inTrash ? R.string.title_delete : R.string.title_trash);
bnvActions.getMenu().findItem(R.id.action_move).setVisible(

View File

@ -49,7 +49,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor, account.notify AS accountNotify" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", identity.name AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", identity.name AS identityName, identity.email AS identityEmail" +
", COUNT(message.id) AS count" +
", " + unseen_unified + " AS unseen" +
", " + unflagged_unified + " AS unflagged" +
@ -94,7 +94,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor, account.notify AS accountNotify" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", identity.name AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", identity.name AS identityName, identity.email AS identityEmail" +
", COUNT(message.id) AS count" +
", " + unseen_folder + " AS unseen" +
", " + unflagged_folder + " AS unflagged" +
@ -131,7 +131,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor, account.notify AS accountNotify" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", identity.name AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", identity.name AS identityName, identity.email AS identityEmail" +
", 1 AS count" +
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
@ -237,7 +237,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.name AS accountName, identity.color AS accountColor, account.notify AS accountNotify" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", identity.name AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", identity.name AS identityName, identity.email AS identityEmail" +
", 1 AS count" +
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
@ -255,7 +255,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor, account.notify AS accountNotify" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", identity.name AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", identity.name AS identityName, identity.email AS identityEmail" +
", 1 AS count" +
", 1 AS unseen" +
", 0 AS unflagged" +

View File

@ -32,7 +32,6 @@ public class TupleMessageEx extends EntityMessage {
public String folderType;
public String identityName;
public String identityEmail;
public Boolean identitySynchronize;
public int count;
public int unseen;
public int unflagged;
@ -56,7 +55,6 @@ public class TupleMessageEx extends EntityMessage {
this.folderType.equals(other.folderType) &&
Objects.equals(this.identityName, other.identityName) &&
Objects.equals(this.identityEmail, other.identityEmail) &&
Objects.equals(this.identitySynchronize, other.identitySynchronize) &&
this.count == other.count &&
this.unseen == other.unseen &&
this.unflagged == other.unflagged &&
@ -84,6 +82,7 @@ public class TupleMessageEx extends EntityMessage {
this.unseen == other.unseen &&
this.unflagged == other.unflagged &&
this.attachments == other.attachments &&
this.drafts == other.drafts &&
this.visible == other.visible &&
Objects.equals(this.totalSize, other.totalSize) &&
this.duplicate == other.duplicate);