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)
| 2024 | /// |
| 2025 | /// Returns tombstone database row ID. |
| 2026 | pub(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 |
| 2039 | pub async fn get_unblocked_msg_cnt(context: &Context) -> usize { |
no test coverage detected