Small improvement

pull/153/head
M66B 6 years ago
parent 123b979aba
commit c8dc7d3915

@ -1530,7 +1530,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
DB db = DB.getInstance(context);
EntityAttachment attachment = db.attachment().getAttachment(id);
if (attachment == null)
throw new FileNotFoundException();
return null;
File file = attachment.getFile(context);
ParcelFileDescriptor pfd = null;

@ -38,7 +38,6 @@ import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@ -174,7 +173,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
DB db = DB.getInstance(context);
EntityAttachment attachment = db.attachment().getAttachment(id);
if (attachment == null)
throw new FileNotFoundException();
return null;
db.attachment().setDownloaded(id, null);
attachment.getFile(context).delete();
db.attachment().deleteAttachment(id);

@ -27,7 +27,6 @@ import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
@ -712,7 +711,7 @@ public class MessageHelper {
AttachmentPart apart = attachments.get(index);
EntityAttachment attachment = db.attachment().getAttachment(id);
if (attachment == null)
throw new FileNotFoundException();
return;
File file = attachment.getFile(context);
// Download attachment

Loading…
Cancel
Save