pull/182/head
M66B 5 years ago
parent 63636158d8
commit d063ead7ee

@ -1425,7 +1425,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibImages.setVisibility(View.GONE); ibImages.setVisibility(View.GONE);
ibDecrypt.setVisibility(View.GONE); ibDecrypt.setVisibility(View.GONE);
ibVerify.setVisibility(View.GONE); ibVerify.setVisibility(View.GONE);
ibUndo.setVisibility(EntityFolder.OUTBOX.equals(message.folderType) ? View.VISIBLE : View.GONE); ibUndo.setVisibility(View.GONE);
ibRule.setVisibility(View.GONE); ibRule.setVisibility(View.GONE);
ibUnsubscribe.setVisibility(View.GONE); ibUnsubscribe.setVisibility(View.GONE);
ibAnswer.setVisibility(View.GONE); ibAnswer.setVisibility(View.GONE);
@ -1563,19 +1563,20 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibTrash.setTag(delete); ibTrash.setTag(delete);
ibUndo.setVisibility(outbox ? View.VISIBLE : View.GONE);
ibRule.setVisibility(tools && experiments && !outbox && ibRule.setVisibility(tools && experiments && !outbox &&
message.accountProtocol == EntityAccount.TYPE_IMAP ? View.VISIBLE : View.GONE); message.accountProtocol == EntityAccount.TYPE_IMAP ? View.VISIBLE : View.GONE);
ibUnsubscribe.setVisibility(!tools || message.unsubscribe == null ? View.GONE : View.VISIBLE); ibUnsubscribe.setVisibility(!tools || message.unsubscribe == null ? View.GONE : View.VISIBLE);
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE); ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE);
ibLabels.setVisibility(tools && labels_header && labels ? View.VISIBLE : View.GONE); ibLabels.setVisibility(tools && labels_header && labels && !outbox ? View.VISIBLE : View.GONE);
ibMove.setVisibility(tools && move ? View.VISIBLE : View.GONE); ibMove.setVisibility(tools && move ? View.VISIBLE : View.GONE);
ibArchive.setVisibility(tools && extras && archive ? View.VISIBLE : View.GONE); ibArchive.setVisibility(tools && extras && archive ? View.VISIBLE : View.GONE);
ibTrash.setVisibility(tools && extras && trash ? View.VISIBLE : View.GONE); ibTrash.setVisibility(outbox || (tools && extras && trash) ? View.VISIBLE : View.GONE);
ibJunk.setVisibility(tools && junk ? View.VISIBLE : View.GONE); ibJunk.setVisibility(tools && junk ? View.VISIBLE : View.GONE);
ibInbox.setVisibility(tools && inbox ? View.VISIBLE : View.GONE); ibInbox.setVisibility(tools && inbox ? View.VISIBLE : View.GONE);
ibMore.setVisibility(!tools || outbox ? View.GONE : View.VISIBLE); ibMore.setVisibility(!tools || outbox ? View.GONE : View.VISIBLE);
ibTools.setImageLevel(tools ? 0 : 1); ibTools.setImageLevel(tools ? 0 : 1);
ibTools.setVisibility(View.VISIBLE); ibTools.setVisibility(outbox ? View.GONE : View.VISIBLE);
ibTrashBottom.setVisibility(extras && trash ? View.VISIBLE : View.GONE); ibTrashBottom.setVisibility(extras && trash ? View.VISIBLE : View.GONE);
ibArchiveBottom.setVisibility(extras && archive ? View.VISIBLE : View.GONE); ibArchiveBottom.setVisibility(extras && archive ? View.VISIBLE : View.GONE);
@ -3651,17 +3652,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
protected Void onExecute(Context context, Bundle args) { protected Void onExecute(Context context, Bundle args) {
long id = args.getLong("id"); long id = args.getLong("id");
EntityMessage message;
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
try { try {
db.beginTransaction(); db.beginTransaction();
message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
if (message == null) if (message == null)
return null; return null;
db.folder().setFolderError(message.folder, null); db.folder().setFolderError(message.folder, null);
if (message.identity != null)
db.identity().setIdentityError(message.identity, null);
File source = message.getFile(context); File source = message.getFile(context);
@ -3693,11 +3694,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ServiceSynchronize.eval(context, "outbox/drafts"); ServiceSynchronize.eval(context, "outbox/drafts");
if (message.identity != null) { NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// Identity can be deleted nm.cancel("send:" + id, 1);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel("send:" + message.id, 1);
}
return null; return null;
} }

@ -6205,12 +6205,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
db.message().deleteMessage(id); db.message().deleteMessage(id);
db.folder().setFolderError(message.folder, null); db.folder().setFolderError(message.folder, null);
if (message.identity != null) { if (message.identity != null)
db.identity().setIdentityError(message.identity, null); db.identity().setIdentityError(message.identity, null);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel("send:" + message.id, 1);
}
} else if (message.uid == null && account.protocol == EntityAccount.TYPE_IMAP) { } else if (message.uid == null && account.protocol == EntityAccount.TYPE_IMAP) {
db.message().deleteMessage(id); db.message().deleteMessage(id);
db.folder().setFolderError(message.folder, null); db.folder().setFolderError(message.folder, null);
@ -6224,6 +6220,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
ServiceSynchronize.eval(context, "delete"); ServiceSynchronize.eval(context, "delete");
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel("send:" + id, 1);
return null; return null;
} }

@ -558,6 +558,8 @@ public class ServiceSend extends ServiceBase {
// Send message // Send message
EntityLog.log(this, "Sending " + via); EntityLog.log(this, "Sending " + via);
if (BuildConfig.DEBUG && false)
throw new SendFailedException("Test");
iservice.getTransport().sendMessage(imessage, to); iservice.getTransport().sendMessage(imessage, to);
long time = new Date().getTime(); long time = new Date().getTime();
EntityLog.log(this, "Sent " + via); EntityLog.log(this, "Sent " + via);

Loading…
Cancel
Save