Add deleteMessages() method to Backend interface

This commit is contained in:
cketti 2019-03-10 23:56:42 +01:00
parent f814e4dd17
commit 91e5f629fd
4 changed files with 17 additions and 0 deletions

View file

@ -44,6 +44,9 @@ interface Backend {
@Throws(MessagingException::class)
fun expungeMessages(folderServerId: String, messageServerIds: List<String>)
@Throws(MessagingException::class)
fun deleteMessages(folderServerId: String, messageServerIds: List<String>)
@Throws(MessagingException::class)
fun deleteAllMessages(folderServerId: String)

View file

@ -146,6 +146,12 @@ public class ImapBackend implements Backend {
commandExpunge.expungeMessages(folderServerId, messageServerIds);
}
@Override
public void deleteMessages(@NotNull String folderServerId, @NotNull List<String> messageServerIds)
throws MessagingException {
commandSetFlag.setFlag(folderServerId, messageServerIds, Flag.DELETED, true);
}
@Override
public void deleteAllMessages(@NotNull String folderServerId) throws MessagingException {
commandDeleteAll.deleteAll(folderServerId);

View file

@ -65,6 +65,10 @@ class Pop3Backend(
throw UnsupportedOperationException("not supported")
}
override fun deleteMessages(folderServerId: String, messageServerIds: List<String>) {
commandSetFlag.setFlag(folderServerId, messageServerIds, Flag.DELETED, true)
}
override fun deleteAllMessages(folderServerId: String) {
commandDeleteAll.deleteAll(folderServerId)
}

View file

@ -70,6 +70,10 @@ class WebDavBackend(
throw UnsupportedOperationException("not supported")
}
override fun deleteMessages(folderServerId: String, messageServerIds: List<String>) {
commandSetFlag.setFlag(folderServerId, messageServerIds, Flag.DELETED, true)
}
override fun deleteAllMessages(folderServerId: String) {
commandDeleteAll.deleteAll(folderServerId)
}