-
-
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
|
|
||
| /// Returns the size of the file in bytes, if applicable. | ||
| /// If message is a pre-message, then this returns size of the to be downloaded file. | ||
| pub async fn get_filebytes(&self, context: &Context) -> Result<Option<u64>> { |
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.
maybe modifying this is not the best idea.
A new property/method might be better and easier to understand.
Like when UIs show attachment size of messages for a storage usage UI, then it would always need to check if it is downloaded yet. Could be confusing with thumbnails which also have their own size.
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.Chat-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