MCPcopy Create free account
hub / github.com/chatmail/core / insert_tombstone

Function insert_tombstone

src/message.rs:2026–2036  ·  view source on GitHub ↗

Inserts a tombstone into `msgs` table to prevent downloading the same message in the future. Returns tombstone database row ID.

(context: &Context, rfc724_mid: &str)

Source from the content-addressed store, hash-verified

2024///
2025/// Returns tombstone database row ID.
2026pub(crate) async fn insert_tombstone(context: &Context, rfc724_mid: &str) -> Result<MsgId> {
2027 let row_id = context
2028 .sql
2029 .insert(
2030 "INSERT INTO msgs(rfc724_mid, chat_id) VALUES (?,?)",
2031 (rfc724_mid, DC_CHAT_ID_TRASH),
2032 )
2033 .await?;
2034 let msg_id = MsgId::new(u32::try_from(row_id)?);
2035 Ok(msg_id)
2036}
2037
2038/// The number of messages assigned to unblocked chats
2039pub async fn get_unblocked_msg_cnt(context: &Context) -> usize {

Callers 4

receive_imf_innerFunction · 0.85
handle_edit_deleteFunction · 0.85
send_handshake_messageFunction · 0.85

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected