From 1afbbbc737060304e6712539d4e1cba6ac8efb9e Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 17 Apr 2022 11:56:48 +0000 Subject: [PATCH] Rename markseen_on_imap to markseen_on_imap_table and document it --- src/dc_receive_imf.rs | 4 ++-- src/imap.rs | 6 ++++-- src/message.rs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 3b7d2677e..dc538ffe6 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -24,7 +24,7 @@ use crate::download::DownloadState; use crate::ephemeral::{stock_ephemeral_timer_changed, Timer as EphemeralTimer}; use crate::events::EventType; use crate::headerdef::{HeaderDef, HeaderDefMap}; -use crate::imap::markseen_on_imap; +use crate::imap::markseen_on_imap_table; use crate::location; use crate::log::LogExt; use crate::message::{ @@ -339,7 +339,7 @@ pub(crate) async fn dc_receive_imf_inner( .await?; } else if !mime_parser.mdn_reports.is_empty() && mime_parser.has_chat_version() { // This is a Delta Chat MDN. Mark as read. - markseen_on_imap(context, rfc724_mid).await?; + markseen_on_imap_table(context, rfc724_mid).await?; } } diff --git a/src/imap.rs b/src/imap.rs index 2dcd0634a..75e910bc1 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -1936,7 +1936,7 @@ pub(crate) async fn prefetch_should_download( .await? .is_some() { - markseen_on_imap(context, message_id).await?; + markseen_on_imap_table(context, message_id).await?; return Ok(false); } @@ -2070,7 +2070,9 @@ async fn mark_seen_by_uid( } } -pub(crate) async fn markseen_on_imap(context: &Context, message_id: &str) -> Result<()> { +/// Schedule marking the message as Seen on IMAP by adding all known IMAP messages corresponding to +/// the given Message-ID to `imap_markseen` table. +pub(crate) async fn markseen_on_imap_table(context: &Context, message_id: &str) -> Result<()> { context .sql .execute( diff --git a/src/message.rs b/src/message.rs index 1a137f0ee..2083ade5e 100644 --- a/src/message.rs +++ b/src/message.rs @@ -22,7 +22,7 @@ use crate::dc_tools::{ use crate::download::DownloadState; use crate::ephemeral::{start_ephemeral_timers_msgids, Timer as EphemeralTimer}; use crate::events::EventType; -use crate::imap::markseen_on_imap; +use crate::imap::markseen_on_imap_table; use crate::job::{self, Action}; use crate::log::LogExt; use crate::mimeparser::{parse_message_id, FailureReport, SystemMessage}; @@ -1357,7 +1357,7 @@ pub async fn markseen_msgs(context: &Context, msg_ids: Vec) -> Result<()> update_msg_state(context, id, MessageState::InSeen).await?; info!(context, "Seen message {}.", id); - markseen_on_imap(context, &curr_rfc724_mid).await?; + markseen_on_imap_table(context, &curr_rfc724_mid).await?; // Read receipts for system messages are never sent. These messages have no place to // display received read receipt anyway. And since their text is locally generated,