diff --git a/index.html b/index.html index c43bb78..3123831 100644 --- a/index.html +++ b/index.html @@ -100,8 +100,8 @@ Greet recipients (by proper names if possible) - - Try recover from a mismatched address/subject error + + Ignore address/subject mismatch errors Enable task slicing diff --git a/main.py b/main.py index ee962b4..2a6fe71 100644 --- a/main.py +++ b/main.py @@ -283,9 +283,9 @@ def main(driver: Chrome, logger = logging.getLogger('main')): flow.append(Skip) sp.set('actions', lambda: flow.capabilities()) - sp.set('cancel', lambda: flow.do(Cancel)) - sp.set('close', lambda: flow.do(Close)) - sp.set('skip', lambda: flow.do(Skip)) + sp.set('cancel', lambda: flow.do(Cancel, force=True)) + sp.set('close', lambda: flow.do(Close, force=True)) + sp.set('skip', lambda: flow.do(Skip, force=True)) def loads(name: str, b64: str): from base64 import b64decode @@ -428,8 +428,7 @@ def main(driver: Chrome, logger = logging.getLogger('main')): while mails := driver.find_elements(By.CSS_SELECTOR, "div.io-ox-mail-compose-window"): try: - click(mails[0].find_element(By.CSS_SELECTOR, "button[data-action='close']"), wait=False) - click("div.modal-footer button[data-action='delete']", wait=False) + click(mails[0].find_element(By.CSS_SELECTOR, "button[data-action='minimize']"), wait=False) except Exception as e: logger.warning('Unable to close off email compose windows', exc_info=e) break @@ -446,29 +445,12 @@ def main(driver: Chrome, logger = logging.getLogger('main')): if (target := get_address()) != parameters['account']: error = MismatchedEmailAddress(target) - if not options.get('recovery'): raise error - + if (target := get_subject()) != subject: error = MismatchedEmailSubject(target) - if not options.get('recovery'): raise error - if error is not None and (c := EC.presence_of_element_located): - click("li[data-id='virtual/standard'] > .subfolders li:nth-child(6) .folder-arrow", condition=c) - click("li[data-id='virtual/standard'] > .subfolders li:nth-child(6) li.folder:nth-child(1)", condition=c) - catch(ready, force=False) - click("ul[aria-label='List view'] li[data-index='0']", condition=c) - catch(ready, force=False) - click("ul.classic-toolbar button[aria-label='More actions']", condition=c) - click(".abs + ul.dropdown-menu a[data-action='io.ox/mail/actions/copy']", condition=c) - click(".modal-dialog ul.subfolders li[data-id='default0/Brouillons']", condition=c) - click(".modal-dialog .modal-footer button[data-action='ok']", condition=c) - click("li[data-id='default0/Brouillons']") - - for _ in range(parameters['attempts']): - catch(ready, force=False) - click("ul[aria-label='List view'] li[data-index='0']", condition=c) - if get_subject() == subject: break - if not get_subject() == subject: raise error + if error is not None and not options.get('force'): + raise error flow.do(Wait) flow.react() diff --git a/requirements.txt b/requirements.txt index 427dcd9..2791de0 100644 Binary files a/requirements.txt and b/requirements.txt differ