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

Method get_existing_msg_ids

deltachat-jsonrpc/src/api.rs:1422–1435  ·  view source on GitHub ↗

Checks if the messages with given IDs exist. Returns IDs of existing messages.

(&self, account_id: u32, msg_ids: Vec<u32>)

Source from the content-addressed store, hash-verified

1420 ///
1421 /// Returns IDs of existing messages.
1422 async fn get_existing_msg_ids(&self, account_id: u32, msg_ids: Vec<u32>) -> Result<Vec<u32>> {
1423 if let Some(context) = self.get_context_opt(account_id).await {
1424 let msg_ids: Vec<MsgId> = msg_ids.into_iter().map(MsgId::new).collect();
1425 let existing_msg_ids = get_existing_msg_ids(&context, &msg_ids).await?;
1426 Ok(existing_msg_ids
1427 .into_iter()
1428 .map(|msg_id| msg_id.to_u32())
1429 .collect())
1430 } else {
1431 // Account does not exist, so messages do not exist either,
1432 // but this is not an error.
1433 Ok(Vec::new())
1434 }
1435 }
1436
1437 /// Get all messages belonging to a chat.
1438 ///

Callers 1

existsMethod · 0.80

Calls 3

get_existing_msg_idsFunction · 0.85
get_context_optMethod · 0.80
to_u32Method · 0.45

Tested by

no test coverage detected