-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Small change for #5999 #6047
Closed
Hocuri
wants to merge
3
commits into
iequidoo/markseen_not_downloaded_msg
from
hoc/markseen_not_downloaded_msg
Closed
Small change for #5999 #6047
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1014,7 +1014,10 @@ async fn add_parts( | |
} | ||
} | ||
|
||
state = if seen | ||
state = if replace_msg_id.is_some() { | ||
// TODO a comment explaining why we're doing this would be nice | ||
MessageState::InNoticed | ||
} else if seen | ||
|| fetching_existing_messages | ||
|| is_mdn | ||
|| is_reaction | ||
|
@@ -1562,7 +1565,7 @@ INSERT INTO msgs | |
ON CONFLICT (id) DO UPDATE | ||
SET rfc724_mid=excluded.rfc724_mid, chat_id=excluded.chat_id, | ||
from_id=excluded.from_id, to_id=excluded.to_id, timestamp_sent=excluded.timestamp_sent, | ||
type=excluded.type, msgrmsg=excluded.msgrmsg, | ||
type=excluded.type, state=min(state,excluded.state), msgrmsg=excluded.msgrmsg, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As for this, i agree that |
||
txt=excluded.txt, txt_normalized=excluded.txt_normalized, subject=excluded.subject, | ||
txt_raw=excluded.txt_raw, param=excluded.param, | ||
hidden=excluded.hidden,bytes=excluded.bytes, mime_headers=excluded.mime_headers, | ||
|
@@ -1613,7 +1616,7 @@ RETURNING id | |
} else { | ||
DownloadState::Done | ||
}, | ||
mime_parser.hop_info | ||
mime_parser.hop_info, | ||
], | ||
|row| { | ||
let msg_id: MsgId = row.get(0)?; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure that the code can be rewritten this way. If a message is replaced, that doesn't mean it's already noticed. Maybe it's replaced because
DownloadLimit
was changed and the message was resent. But i didn't test such a scenario, so i decided not to change the code here too much