fix python lint errors
receive pre-mesages, start with changes to imap loop.
refactor: move download code from `scheduler.rs` to `download.rs`, also
move `get_msg_id_by_rfc724_mid` to `MsgId::get_by_rfc724_mid`
`MAX_FETCH_MSG_SIZE` is no longer unused
Parse if it is a pre-message or full-message
start with receiving logic
get rid of `MsgId::get_by_rfc724_mid` because it was a duplicate of
`message::rfc724_mid_exists`
docs: add hint to `MimeMessage::from_bytes` stating that it has
side-effects.
receiving full message
send and receive `attachment_size` and set viewtype to text in
pre_message
metadata as struct in pre-message in header. And fill params that we can
already fill from the metadata. Also add a new api to check what
viewtype the message will have once downloaded.
api: jsonrpc: add `full_message_view_type` to `Message` and
`MessageInfo`
make PreMsgMetadata.to_header_value not consume self/PreMsgMetadata
add api to merge params
on download full message: merge new params into old params and remove
full-message metadata params
move tests to `src/tests/pre_messages.rs`
dynamically allocate test attachment bytes
fix detection of pre-messages. (it looked for the ChatFullMessageId
header in the unencrypted headers before)
fix setting dl state to avaiable on pre-messages
fix: save pre message with rfc724_mid of full message als disable
replacement for full messages
add some receiving tests and update test todo for premessage metadata
test: process full message before pre-message
test receive normal message
some serialization tests for PreMsgMetadata
remove outdated todo comment
test that pre-message contains message text
PreMsgMetadata: test_build_from_file_msg and test_build_from_file_msg
test: test_receive_pre_message_image
Test receiving the full message after receiving an edit after receiving
the pre-message
test_reaction_on_pre_message
test_full_download_after_trashed
test_webxdc_update_for_not_downloaded_instance
simplify fake webxdc generation in
test_webxdc_update_for_not_downloaded_instance
test_markseen_pre_msg
test_pre_msg_can_start_chat and test_full_msg_can_start_chat
test_download_later_keeps_message_order
test_chatlist_event_on_full_msg_download
fix download not working
log splitting into pre-message
add pre-message info to text when loading from db. this can be disabled
with config key `hide_pre_message_metadata_text` if ui wants to display
it in a prettier way.
update `download_limit` documentation
more logging: log size of pre and post messages
rename full message to Post-Message
split up the pre-message tests into multiple files
dedup test code by extracting code to create test messages into util
methods
remove post_message_view_type from api, now it is only used internally
for tests
remove `hide_pre_message_metadata_text` config option, as there
currently is no way to get the full message viewtype anymore
Update src/download.rs
resolve comment
use `parse_message_id` instead of removing `<>`parenthesis it manually
fix available_post_msgs gets no entries
handle forwarding and add a test for it.
convert comment to log warning event on unexpected download failure
add doc comment to `simple_imap_loop`
more logging
handle saving pre-message to self messages and test.
part of #7367
progress / what's to do:
- [x] send pre-message
- [x] The message's state must be set to MessageState::OutDelivered only
after both messages are sent. If a read receipt is received, the message
can be OutMdnRcvd or OutPending; let's just do whatever is easiest for
now. Take care not to revert from OutMdnReceived to OutDelivered if we
first receive a read receipt and then deliver the full message.
- this is already the case:
- `OutDelivered` is set when a message is sent out and has no remaining
send jobs in the smtp table for this message id - so already works since
full message and pre message have same msgId in that table.
- `OutMdnRcvd` is a "virtual" state
(https://github.com/chatmail/core/issues/7367#issuecomment-3500891040),
so going back to `OutDelivered` can't happen anymore
- [x] delimit `ChatFullMessageId` with `<` and `>` like the other
message ids
- [x] add tests
- [x] test that pre message is sent for attachment larger than X
- test that correct headers are present on both messages
- also test that Autocrypt-gossip and selfavatar should never go into
full-messages
- [x] test that no pre message is sent for attachment smaller than X
- no "is full message" header should be present
- [x] test that pre message is not send for large webxdc update or large
text
- [x] fix test
`receive_imf::receive_imf_tests::test_dont_reverify_by_self_on_outgoing_msg`
---------
Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com>
Co-authored-by: Hocuri <hocuri@gmx.de>
The events are needed when you are not using chatmail core from rust, if
you use chatmail core from your rust bot or from tauri, then you likely
already use the rust logging/tracing ecosystem. So it makes sense to use
it instead of listening to the events and logging them yourself.
This pr fixes a few cases where the event was direclty emitted instead
of using the macro and thus was not also automatically logged via
tracing.
Add `chat::forward_msgs_2ctx()` which takes another context as a parameter and forwards messages to
it and its jsonrpc wrapper `CommandApi::forward_messages_to_account()`.
We periodically forget to remove new params from forwarded messages as this can't be catched by
existing tests, some examples:
bfc08abe88a1837aeb8c56b2361f01
This may leak confidential data. Instead, it's better to explicitly list params that we want to
forward, then if we forget to forward some param, a test on forwarding messages carrying the new
functionality will break, or the bug will be reported earlier, it's easier to notice that some info
is missing than some extra info is leaked.
Fix get_secondary_addrs() which was using
`secondary_addrs` config that is not updated anymore.
Instead of using `secondary_addrs` config,
use the `transports` table which contains all the addresses.
This makes `Contact::get_all()` and `Chatlist::try_load()` case-insensitive for non-ASCII chat and
contact names as well. The same approach as in f6f4ccc6ea "feat:
Case-insensitive search for non-ASCII messages (#5052)" is used: `chats.name_normalized` and
`contacts.name_normalized` colums are added which store lowercased/normalized names (for a contact,
if the name is unset, it's a normalized authname). If a normalized name is the same as the
chat/contact name, it's not stored to reduce the db size. A db migration is added for 10000 random
chats and the same number of the most recently seen contacts, for users it will probably migrate all
chats/contacts and for bots which may have more data it's not important.
Many clients don't send it currently, so it is unlikely that servers depend on it:
https://mastodon.social/@cks/114690055923939576.
For "implicit TLS", do not turn it off yet, it will serve as a fallback in case of rare server that
needs it. If the server only supports STARTTLS and requires SNI then it is really weird, likely
should not happen.