mirror of https://github.com/M66B/FairEmail.git
Prevent downloading attachments of local (moved) messages
This commit is contained in:
parent
18d63048c1
commit
c028297c57
|
@ -235,17 +235,20 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
||||||
@Override
|
@Override
|
||||||
protected Void onExecute(Context context, Bundle args) {
|
protected Void onExecute(Context context, Bundle args) {
|
||||||
long id = args.getLong("id");
|
long id = args.getLong("id");
|
||||||
long message = args.getLong("message");
|
long mid = args.getLong("message");
|
||||||
long sequence = args.getInt("sequence");
|
long sequence = args.getInt("sequence");
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
|
|
||||||
|
EntityMessage message = db.message().getMessage(mid);
|
||||||
|
if (message == null || message.uid == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
db.attachment().setProgress(id, 0);
|
db.attachment().setProgress(id, 0);
|
||||||
|
|
||||||
EntityMessage msg = db.message().getMessage(message);
|
EntityOperation.queue(context, db, message, EntityOperation.ATTACHMENT, sequence);
|
||||||
EntityOperation.queue(context, db, msg, EntityOperation.ATTACHMENT, sequence);
|
|
||||||
|
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue