Added quick remove

This commit is contained in:
M66B 2020-08-09 07:35:53 +02:00
parent dc574e466e
commit ce8f1c677c
2 changed files with 11 additions and 4 deletions

View File

@ -1108,16 +1108,19 @@ class Core {
private static void onFetch(Context context, JSONArray jargs, EntityFolder folder, IMAPStore istore, IMAPFolder ifolder, State state) throws JSONException, MessagingException, IOException {
long uid = jargs.getLong(0);
boolean removed = jargs.optBoolean(1);
if (uid < 0)
throw new MessageRemovedException(folder.name + " fetch uid=" + uid);
DB db = DB.getInstance(context);
EntityAccount account = db.account().getAccount(folder.account);
boolean download = db.folder().getFolderDownload(folder.id);
List<EntityRule> rules = db.rule().getEnabledRules(folder.id);
try {
SyncStats stats = new SyncStats();
if (removed) {
db.message().deleteMessage(folder.id, uid);
throw new MessageRemovedException("removed uid=" + uid);
}
MimeMessage imessage = (MimeMessage) ifolder.getMessageByUID(uid);
if (imessage == null)
@ -1127,6 +1130,10 @@ class Core {
if (imessage.isSet(Flags.Flag.DELETED))
throw new MessageRemovedException(folder.name + " fetch deleted uid=" + uid);
SyncStats stats = new SyncStats();
boolean download = db.folder().getFolderDownload(folder.id);
List<EntityRule> rules = db.rule().getEnabledRules(folder.id);
try {
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);

View File

@ -1139,7 +1139,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
for (Message imessage : e.getMessages()) {
long uid = ifolder.getUID(imessage);
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid, true);
}
db.setTransactionSuccessful();