|
|
|
@ -291,6 +291,8 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
long mid = args.getLong("message");
|
|
|
|
|
|
|
|
|
|
Long reload = null;
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
try {
|
|
|
|
|
db.beginTransaction();
|
|
|
|
@ -299,6 +301,13 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
|
|
|
|
if (message == null || message.uid == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
EntityAccount account = db.account().getAccount(message.id);
|
|
|
|
|
if (account == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
if (!"connected".equals(account.state))
|
|
|
|
|
reload = account.id;
|
|
|
|
|
|
|
|
|
|
EntityAttachment attachment = db.attachment().getAttachment(id);
|
|
|
|
|
if (attachment == null || attachment.progress != null || attachment.available)
|
|
|
|
|
return null;
|
|
|
|
@ -310,7 +319,10 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "attachment");
|
|
|
|
|
if (reload == null)
|
|
|
|
|
ServiceSynchronize.eval(context, "attachment");
|
|
|
|
|
else
|
|
|
|
|
ServiceSynchronize.reload(context, reload, true, "attachment");
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|