Added expunge operation

This commit is contained in:
M66B 2021-02-12 12:51:34 +01:00
parent 7491327cd4
commit ba75513ba1
4 changed files with 12 additions and 0 deletions

1
FAQ.md
View File

@ -404,6 +404,7 @@ The low priority status bar notification shows the number of pending operations,
* *send*: send message
* *exists*: check if message exists
* *rule*: execute rule on body text
* *expunge*: permanently delete messages
Operations are processed only when there is a connection to the email server or when manually synchronizing.
See also [this FAQ](#user-content-faq16).

View File

@ -409,6 +409,10 @@ class Core {
onPurgeFolder(context, jargs, folder, (IMAPFolder) ifolder);
break;
case EntityOperation.EXPUNGE:
onExpungeFolder(context, jargs, folder, (IMAPFolder) ifolder);
break;
case EntityOperation.RULE:
onRule(context, jargs, message);
break;
@ -1999,6 +2003,11 @@ class Core {
}
}
private static void onExpungeFolder(Context context, JSONArray jargs, EntityFolder folder, IMAPFolder ifolder) throws MessagingException {
Log.i(folder.name + " expunge");
ifolder.expunge();
}
private static void onPurgeFolder(Context context, EntityFolder folder) {
// POP3
DB db = DB.getInstance(context);

View File

@ -43,6 +43,7 @@ public interface DaoOperation {
" WHEN operation.name = '" + EntityOperation.MOVE + "' THEN 5" +
" WHEN operation.name = '" + EntityOperation.PURGE + "' THEN 6" +
" WHEN operation.name = '" + EntityOperation.DELETE + "' THEN 7" +
" WHEN operation.name = '" + EntityOperation.EXPUNGE + "' THEN 8" +
" ELSE 0" +
" END";

View File

@ -100,6 +100,7 @@ public class EntityOperation {
static final String EXISTS = "exists";
static final String RULE = "rule";
static final String PURGE = "purge";
static final String EXPUNGE = "expunge";
private static final int MAX_FETCH = 100; // operations