expose empty server functionality and test it (also introducing a new DC_EVENT_IMAP_FOLDER_EMPTIED event)

This commit is contained in:
holger krekel
2019-10-29 19:05:25 +01:00
parent 7628ee1e05
commit 911c0e45dc
10 changed files with 117 additions and 6 deletions

View File

@@ -135,6 +135,17 @@ class Account(object):
if not self.is_configured():
raise ValueError("need to configure first")
def empty_server_folders(self, inbox=False, mvbox=False):
""" empty server folders. """
flags = 0
if inbox:
flags |= const.DC_EMPTY_INBOX
if mvbox:
flags |= const.DC_EMPTY_MVBOX
if not flags:
raise ValueError("no flags set")
lib.dc_empty_server(self._dc_context, flags)
def get_infostring(self):
""" return info of the configured account. """
self.check_is_configured()