GODT-1954: Draft message support

Add special case handling for draft messages so that if a Draft is
updated via an event it is correctly updated on the IMAP client via a
the new `imap.MessageUpdated event`.

This patch also updates Gluon to the latest version.
This commit is contained in:
Jakub
2022-10-31 13:52:11 +01:00
committed by James Houlahan
parent c548ba85fe
commit 1e29a5210f
14 changed files with 286 additions and 53 deletions

View File

@ -24,10 +24,10 @@ Feature: IMAP create messages
| from | to | subject | body |
| user@pm.me | john.doe@email.com | foo | bar |
Then it succeeds
And IMAP client "1" sees the following messages in "Drafts":
And IMAP client "1" eventually sees the following messages in "Drafts":
| from | to | subject | body |
| user@pm.me | john.doe@email.com | foo | bar |
And IMAP client "1" sees the following messages in "All Mail":
And IMAP client "1" eventually sees the following messages in "All Mail":
| from | to | subject | body |
| user@pm.me | john.doe@email.com | foo | bar |

View File

@ -7,7 +7,7 @@ Feature: IMAP remove messages from Trash
| label | label |
Scenario Outline: Message in Trash or Spam and some other label is not permanently deleted
And the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | foo | hello |
| jane.doe@mail.com | name@pm.me | bar | world |
@ -35,7 +35,7 @@ Feature: IMAP remove messages from Trash
| Trash |
Scenario Outline: Message in Trash or Spam only is permanently deleted
And the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | foo | hello |
| jane.doe@mail.com | name@pm.me | bar | world |

View File

@ -0,0 +1,40 @@
Feature: IMAP Draft messages
Background:
Given there exists an account with username "user@pm.me" and password "password"
And bridge starts
And the user logs in with username "user@pm.me" and password "password"
And user "user@pm.me" finishes syncing
And user "user@pm.me" connects and authenticates IMAP client "1"
And IMAP client "1" selects "Drafts"
When IMAP client "1" appends the following message to "Drafts":
"""
This is a dra
"""
Scenario: Draft edited locally
When IMAP client "1" marks message 1 as deleted
And IMAP client "1" expunges
And IMAP client "1" appends the following message to "Drafts":
"""
Subject: Basic Draft
Content-Type: text/plain
To: someone@proton.me
This is a draft, but longer
"""
Then it succeeds
And IMAP client "1" eventually sees the following messages in "Drafts":
| to | subject | body |
| someone@proton.me | Basic Draft | This is a draft, but longer |
And IMAP client "1" sees 1 messages in "Drafts"
Scenario: Draft edited remotely
When the following fields where changed in draft 1 for address "user@pm.me" of account "user@pm.me":
| to | subject | body |
| someone@proton.me | Basic Draft | This is a draft body, but longer |
Then IMAP client "1" eventually sees the following messages in "Drafts":
| to | subject | body |
| someone@proton.me | Basic Draft | This is a draft body, but longer |
And IMAP client "1" sees 1 messages in "Drafts"