-
-
Notifications
You must be signed in to change notification settings - Fork 114
feat: receive pre-messages and adapt download on demand #7431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pre-messages
Are you sure you want to change the base?
Conversation
2b900c3 to
305498d
Compare
b94964a to
ce97ba3
Compare
cd716c5 to
4c14566
Compare
move `get_msg_id_by_rfc724_mid` to `MsgId::get_by_rfc724_mid`
`message::rfc724_mid_exists`
already fill from the metadata. Also add a new api to check what viewtype the message will have once downloaded.
full-message metadata params
4c14566 to
ca6bf65
Compare
header in the unencrypted headers before)
replacement for full messages
test_webxdc_update_for_not_downloaded_instance
| "DELETE FROM download WHERE rfc724_mid=?", | ||
| (&msg.rfc724_mid,), | ||
| )?; | ||
| // TODO: is the following nessesary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO: answer the question
In the first iteration, it's not necessary to emit an event, or add any new API. (not sure how the event landed in the "steps" at #7367, but it already is in the "Future Possibilities") |
|
|
||
| /// Download known full messages without pre_message | ||
| /// in order to guard against lost pre-messages: | ||
| // TODO better fn name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any ideas for a better function name?
|
|
||
| chat::mark_old_messages_as_noticed(context, received_msgs).await?; | ||
|
|
||
| // TODO: is there correct place for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address to do comment
| if let Some(full_msg_rfc724_mid) = | ||
| mail.headers.get_header_value(HeaderDef::ChatFullMessageId) | ||
| { | ||
| // TODO: is there a better method for this task? (removing `<>` delimiters of RFC message ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- address to do comment
| .context("delete_expired_imap_messages")?; | ||
|
|
||
| //------- | ||
| // TODO: verify that this is the correct position for this call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- address todo comment
This PR implements receiving of pre-message, download of full messages and the new logic for deciding what to fetch when from IMAP.
This is part of #7367
progress:
rfc724_midinstead ofmsg_id(added db migration for it)available_full_msgsscheduler.rstodownload.rsspecific aspects that should become reality:
Chat-Edit(grep for "ChatEdit" in receive_imf.rs).Chat-Is-Full-Messageheader.background_fetch: If a large message withoutpostponedChat-Is-Full-Messageheader. is received, the UI should be notified via an event.API Changes:
Message.get_filebytes- if message is not downloaded pre message, and metadata is available, then it returns the size that the file has after download, so ui can use this to show download sizeMessage.get_full_message_viewtypeto get view type that message will have after being downloaded.full_message_view_typetoMessageandMessageInfo