State of the message.
For incoming messages, stores the information on whether the message was read or not.
For outgoing message, the message could be pending, already delivered or confirmed.
Delete a single message from the database, including references in other tables.
This may be called in batches; the final events are emitted in delete_msgs_locally_done() then.
Delete messages on all devices, on IMAP and optionally for all chat members.
Deleted messages are moved to the trash chat and scheduling for deletion on IMAP.
When deleting messages for others, all messages must be self-sent and in the same chat.
Do final events and jobs after batch deletion using calls to delete_msg_locally().
To avoid additional database queries, collecting data is up to the caller.
Returns MsgId and βsentβ timestamp of the most recent message with given rfc724_mid
(Message-ID header) and bool expr result if such messages exists in the db.