webmail: store composed message as draft until send, ask about unsaved changes when closing compose window

This commit is contained in:
Mechiel Lukkien
2024-04-20 17:38:25 +02:00
parent e8bbaa451b
commit 9529ae0bd4
10 changed files with 976 additions and 129 deletions

View File

@ -99,6 +99,52 @@
}
]
},
{
"Name": "MessageFindMessageID",
"Docs": "MessageFindMessageID looks up a message by Message-Id header, and returns the ID\nof the message in storage. Used when opening a previously saved draft message\nfor editing again.\nIf no message is find, zero is returned, not an error.",
"Params": [
{
"Name": "messageID",
"Typewords": [
"string"
]
}
],
"Returns": [
{
"Name": "id",
"Typewords": [
"int64"
]
}
]
},
{
"Name": "MessageCompose",
"Docs": "MessageCompose composes a message and saves it to the mailbox. Used for\nsaving draft messages.",
"Params": [
{
"Name": "m",
"Typewords": [
"ComposeMessage"
]
},
{
"Name": "mailboxID",
"Typewords": [
"int64"
]
}
],
"Returns": [
{
"Name": "id",
"Typewords": [
"int64"
]
}
]
},
{
"Name": "MessageSubmit",
"Docs": "MessageSubmit sends a message by submitting it the outgoing email queue. The\nmessage is sent to all addresses listed in the To, Cc and Bcc addresses, without\nBcc message header.\n\nIf a Sent mailbox is configured, messages are added to it after submitting\nto the delivery queue. If Bcc addresses were present, a header is prepended\nto the message stored in the Sent mailbox.",
@ -1083,6 +1129,78 @@
}
]
},
{
"Name": "ComposeMessage",
"Docs": "ComposeMessage is a message to be composed, for saving draft messages.",
"Fields": [
{
"Name": "From",
"Docs": "",
"Typewords": [
"string"
]
},
{
"Name": "To",
"Docs": "",
"Typewords": [
"[]",
"string"
]
},
{
"Name": "Cc",
"Docs": "",
"Typewords": [
"[]",
"string"
]
},
{
"Name": "Bcc",
"Docs": "",
"Typewords": [
"[]",
"string"
]
},
{
"Name": "ReplyTo",
"Docs": "If non-empty, Reply-To header to add to message.",
"Typewords": [
"string"
]
},
{
"Name": "Subject",
"Docs": "",
"Typewords": [
"string"
]
},
{
"Name": "TextBody",
"Docs": "",
"Typewords": [
"string"
]
},
{
"Name": "ResponseMessageID",
"Docs": "If set, this was a reply or forward, based on IsForward.",
"Typewords": [
"int64"
]
},
{
"Name": "DraftMessageID",
"Docs": "If set, previous draft message that will be removed after composing new message.",
"Typewords": [
"int64"
]
}
]
},
{
"Name": "SubmitMessage",
"Docs": "SubmitMessage is an email message to be sent to one or more recipients.\nAddresses are formatted as just email address, or with a name like \"name\n\u003cuser@host\u003e\".",
@ -1118,6 +1236,13 @@
"string"
]
},
{
"Name": "ReplyTo",
"Docs": "If non-empty, Reply-To header to add to message.",
"Typewords": [
"string"
]
},
{
"Name": "Subject",
"Docs": "",
@ -1161,13 +1286,6 @@
"int64"
]
},
{
"Name": "ReplyTo",
"Docs": "If non-empty, Reply-To header to add to message.",
"Typewords": [
"string"
]
},
{
"Name": "UserAgent",
"Docs": "User-Agent header added if not empty.",
@ -1197,6 +1315,13 @@
"Typewords": [
"bool"
]
},
{
"Name": "DraftMessageID",
"Docs": "If set, draft message that will be removed after sending.",
"Typewords": [
"int64"
]
}
]
},