Skip to content

Commit 22bc756

Browse files
committed
refactor: Remove marknoticed_chat_if_older_than()
It was called from `receive_imf` when an outgoing message is received. But `Imap::fetch_new_messages()` already calls `chat::mark_old_messages_as_noticed()` which does the job better (per-message).
1 parent a910808 commit 22bc756

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/chat.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,19 +3231,6 @@ pub async fn get_chat_msgs_ex(
32313231
Ok(items)
32323232
}
32333233

3234-
pub(crate) async fn marknoticed_chat_if_older_than(
3235-
context: &Context,
3236-
chat_id: ChatId,
3237-
timestamp: i64,
3238-
) -> Result<()> {
3239-
if let Some(chat_timestamp) = chat_id.get_timestamp(context).await? {
3240-
if timestamp > chat_timestamp {
3241-
marknoticed_chat(context, chat_id).await?;
3242-
}
3243-
}
3244-
Ok(())
3245-
}
3246-
32473234
/// Marks all messages in the chat as noticed.
32483235
/// If the given chat-id is the archive-link, marks all messages in all archived chats as noticed.
32493236
pub async fn marknoticed_chat(context: &Context, chat_id: ChatId) -> Result<()> {

src/receive_imf.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,11 +1690,6 @@ RETURNING id
16901690
"Message has {icnt} parts and is assigned to chat #{chat_id}."
16911691
);
16921692

1693-
// new outgoing message from another device marks the chat as noticed.
1694-
if !mime_parser.incoming && !chat_id.is_special() {
1695-
chat::marknoticed_chat_if_older_than(context, chat_id, sort_timestamp).await?;
1696-
}
1697-
16981693
if !is_mdn {
16991694
let mut chat = Chat::load_from_db(context, chat_id).await?;
17001695

0 commit comments

Comments
 (0)