mirror of https://github.com/M66B/FairEmail.git
Check if message expunged/deleted on fetch
This commit is contained in:
parent
c6ed38bafe
commit
d55750f3c1
|
@ -1087,7 +1087,7 @@ class Core {
|
||||||
private static void onFetch(Context context, JSONArray jargs, EntityFolder folder, IMAPStore istore, IMAPFolder ifolder, State state) throws JSONException, MessagingException, IOException {
|
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);
|
long uid = jargs.getLong(0);
|
||||||
if (uid < 0)
|
if (uid < 0)
|
||||||
throw new MessageRemovedException("uid");
|
throw new MessageRemovedException(folder.name + " fetch uid=" + uid);
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
EntityAccount account = db.account().getAccount(folder.account);
|
EntityAccount account = db.account().getAccount(folder.account);
|
||||||
|
@ -1099,7 +1099,11 @@ class Core {
|
||||||
|
|
||||||
MimeMessage imessage = (MimeMessage) ifolder.getMessageByUID(uid);
|
MimeMessage imessage = (MimeMessage) ifolder.getMessageByUID(uid);
|
||||||
if (imessage == null)
|
if (imessage == null)
|
||||||
throw new MessageRemovedException();
|
throw new MessageRemovedException(folder.name + " fetch not found uid=" + uid);
|
||||||
|
if (imessage.isExpunged())
|
||||||
|
throw new MessageRemovedException(folder.name + " fetch expunged uid=" + uid);
|
||||||
|
if (imessage.isSet(Flags.Flag.DELETED))
|
||||||
|
throw new MessageRemovedException(folder.name + " fetch deleted uid=" + uid);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FetchProfile fp = new FetchProfile();
|
FetchProfile fp = new FetchProfile();
|
||||||
|
|
Loading…
Reference in New Issue