mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 10:47:28 +00:00
Find POP3 delete
This commit is contained in:
parent
1726989ef0
commit
88d2dcaff4
1 changed files with 12 additions and 3 deletions
|
@ -276,7 +276,7 @@ class Core {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EntityOperation.DELETE:
|
case EntityOperation.DELETE:
|
||||||
onDelete(context, jargs, account, folder, message, (POP3Folder) ifolder, state);
|
onDelete(context, jargs, account, folder, message, (POP3Folder) ifolder, (POP3Store) istore, state);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EntityOperation.SYNC:
|
case EntityOperation.SYNC:
|
||||||
|
@ -986,18 +986,27 @@ class Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void onDelete(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message, POP3Folder ifolder, State state) throws MessagingException {
|
private static void onDelete(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message, POP3Folder ifolder, POP3Store istore, State state) throws MessagingException {
|
||||||
// Delete message
|
// Delete message
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
|
|
||||||
if (!account.browse && EntityFolder.INBOX.equals(folder.type)) {
|
if (!account.browse && EntityFolder.INBOX.equals(folder.type)) {
|
||||||
|
Map<String, String> caps = istore.capabilities();
|
||||||
|
|
||||||
Message[] imessages = ifolder.getMessages();
|
Message[] imessages = ifolder.getMessages();
|
||||||
Log.i(folder.name + " POP messages=" + imessages.length);
|
Log.i(folder.name + " POP messages=" + imessages.length);
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (Message imessage : imessages) {
|
for (Message imessage : imessages) {
|
||||||
MessageHelper helper = new MessageHelper((MimeMessage) imessage);
|
MessageHelper helper = new MessageHelper((MimeMessage) imessage);
|
||||||
String msgid = helper.getMessageID();
|
|
||||||
|
String msgid;
|
||||||
|
if (caps.containsKey("UIDL"))
|
||||||
|
msgid = ifolder.getUID(imessage);
|
||||||
|
else
|
||||||
|
msgid = helper.getMessageID();
|
||||||
|
|
||||||
|
Log.i("POP searching=" + message.msgid + " iterate=" + msgid);
|
||||||
if (msgid != null && msgid.equals(message.msgid)) {
|
if (msgid != null && msgid.equals(message.msgid)) {
|
||||||
found = true;
|
found = true;
|
||||||
Log.i(folder.name + " POP delete=" + msgid);
|
Log.i(folder.name + " POP delete=" + msgid);
|
||||||
|
|
Loading…
Reference in a new issue