Simplification

pull/178/head
M66B 6 years ago
parent 30333cc356
commit bc57c37eda

@ -3434,8 +3434,6 @@ public class FragmentCompose extends FragmentBase {
File file = attachment.getFile(context); File file = attachment.getFile(context);
ics.renameTo(file); ics.renameTo(file);
last_available++;
ICalendar icalendar = Biweekly.parse(file).first(); ICalendar icalendar = Biweekly.parse(file).first();
VEvent event = icalendar.getEvents().get(0); VEvent event = icalendar.getEvents().get(0);
Organizer organizer = event.getOrganizer(); Organizer organizer = event.getOrganizer();
@ -3491,8 +3489,6 @@ public class FragmentCompose extends FragmentBase {
File target = attachment.getFile(context); File target = attachment.getFile(context);
Helper.copy(source, target); Helper.copy(source, target);
last_available++;
if (resize_reply && !"forward".equals(action)) if (resize_reply && !"forward".equals(action))
resizeAttachment(context, attachment, REDUCED_IMAGE_SIZE); resizeAttachment(context, attachment, REDUCED_IMAGE_SIZE);
} else } else
@ -3548,17 +3544,17 @@ public class FragmentCompose extends FragmentBase {
EntityOperation.queue(context, data.draft, EntityOperation.BODY); EntityOperation.queue(context, data.draft, EntityOperation.BODY);
} }
List<EntityAttachment> attachments = db.attachment().getAttachments(data.draft.id);
for (EntityAttachment attachment : attachments)
if (attachment.available) {
if (attachment.encryption == null)
last_available++;
} else
EntityOperation.queue(context, data.draft, EntityOperation.ATTACHMENT, attachment.id);
args.putBoolean("saved", true); args.putBoolean("saved", true);
} }
List<EntityAttachment> attachments = db.attachment().getAttachments(data.draft.id);
for (EntityAttachment attachment : attachments)
if (attachment.available) {
if (attachment.encryption == null)
last_available++;
} else
EntityOperation.queue(context, data.draft, EntityOperation.ATTACHMENT, attachment.id);
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {
db.endTransaction(); db.endTransaction();

Loading…
Cancel
Save